diff --git a/solarnet/build.gradle b/solarnet/build.gradle index b3c4b428e..4fbc3a720 100644 --- a/solarnet/build.gradle +++ b/solarnet/build.gradle @@ -77,6 +77,7 @@ subprojects { commonsIoVersion = '2.17.0' jsonSchemaValidatorVersion = '1.3.2' myBatisStarterVersion = '3.0.3' + okhttp3Mockwebserver = '4.12.0' saxonVersion = '12.4' snCommonVersion = '3.26.0' snCommonExprSpelVersion = '3.1.0' diff --git a/solarnet/cloud-integrations/build.gradle b/solarnet/cloud-integrations/build.gradle index a134865f3..e067695ea 100644 --- a/solarnet/cloud-integrations/build.gradle +++ b/solarnet/cloud-integrations/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' @@ -64,7 +64,7 @@ dependencies { // Testing testImplementation project(':solarnet-common-test') - testImplementation 'com.squareup.okhttp3:mockwebserver' + testImplementation "com.squareup.okhttp3:mockwebserver:${okhttp3Mockwebserver}" } jar.manifest { diff --git a/solarnet/cloud-integrations/src/main/java/net/solarnetwork/central/c2c/config/AlsoEnergyConfig.java b/solarnet/cloud-integrations/src/main/java/net/solarnetwork/central/c2c/config/AlsoEnergyConfig.java index b685e3ebf..d6598f064 100644 --- a/solarnet/cloud-integrations/src/main/java/net/solarnetwork/central/c2c/config/AlsoEnergyConfig.java +++ b/solarnet/cloud-integrations/src/main/java/net/solarnetwork/central/c2c/config/AlsoEnergyConfig.java @@ -146,7 +146,7 @@ public OAuth2AuthorizedClientManager alsoEnergyOauthAuthorizedClientManager( // @formatter:off var authRestOps = new RestTemplateBuilder() - .requestFactory(t -> reqFactory) + .requestFactory(() -> reqFactory) .messageConverters(Arrays.asList( new FormHttpMessageConverter(), tokenResponseConverter)) diff --git a/solarnet/cloud-integrations/src/main/java/net/solarnetwork/central/c2c/config/LocusEnergyConfig.java b/solarnet/cloud-integrations/src/main/java/net/solarnetwork/central/c2c/config/LocusEnergyConfig.java index 78af71f28..4f6fe4673 100644 --- a/solarnet/cloud-integrations/src/main/java/net/solarnetwork/central/c2c/config/LocusEnergyConfig.java +++ b/solarnet/cloud-integrations/src/main/java/net/solarnetwork/central/c2c/config/LocusEnergyConfig.java @@ -142,7 +142,7 @@ public OAuth2AuthorizedClientManager locusEnergyOauthAuthorizedClientManager( // @formatter:off var authRestOps = new RestTemplateBuilder() - .requestFactory(t -> reqFactory) + .requestFactory(() -> reqFactory) .messageConverters(Arrays.asList( new FormHttpMessageConverter(), new OAuth2AccessTokenResponseHttpMessageConverter())) diff --git a/solarnet/common-test/build.gradle b/solarnet/common-test/build.gradle index 492ffdf2c..6e943ff47 100644 --- a/solarnet/common-test/build.gradle +++ b/solarnet/common-test/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/common/build.gradle b/solarnet/common/build.gradle index 88a6b5574..8500e2dcd 100644 --- a/solarnet/common/build.gradle +++ b/solarnet/common/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/commons-multipart/build.gradle b/solarnet/commons-multipart/build.gradle index be2d107b2..3875463d6 100644 --- a/solarnet/commons-multipart/build.gradle +++ b/solarnet/commons-multipart/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/commons-multipart/src/test/java/org/springframework/web/multipart/commons/test/BaseHttpIntegrationTests.java b/solarnet/commons-multipart/src/test/java/org/springframework/web/multipart/commons/test/BaseHttpIntegrationTests.java index 85290ff66..45d43d0ad 100644 --- a/solarnet/commons-multipart/src/test/java/org/springframework/web/multipart/commons/test/BaseHttpIntegrationTests.java +++ b/solarnet/commons-multipart/src/test/java/org/springframework/web/multipart/commons/test/BaseHttpIntegrationTests.java @@ -56,7 +56,7 @@ public abstract class BaseHttpIntegrationTests { * @return the builder */ protected UriComponentsBuilder serverUri(String path) { - return UriComponentsBuilder.fromHttpUrl("http://localhost:%d%s".formatted(port, path)); + return UriComponentsBuilder.fromUriString("http://localhost:%d%s".formatted(port, path)); } } diff --git a/solarnet/datum-input/build.gradle b/solarnet/datum-input/build.gradle index ecc60c21b..b023d9c84 100644 --- a/solarnet/datum-input/build.gradle +++ b/solarnet/datum-input/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/datum-input/src/test/java/net/solarnetwork/central/din/biz/impl/test/DaoDatumInputEndpointBizTests.java b/solarnet/datum-input/src/test/java/net/solarnetwork/central/din/biz/impl/test/DaoDatumInputEndpointBizTests.java index 5e7947e65..9284145cb 100644 --- a/solarnet/datum-input/src/test/java/net/solarnetwork/central/din/biz/impl/test/DaoDatumInputEndpointBizTests.java +++ b/solarnet/datum-input/src/test/java/net/solarnetwork/central/din/biz/impl/test/DaoDatumInputEndpointBizTests.java @@ -444,9 +444,9 @@ public void nodeSourceInputParameters_notAuthorized() throws IOException { // WHEN var parameters = Map.of(DatumInputEndpointBiz.PARAM_NODE_ID, nodeId.toString(), DatumInputEndpointBiz.PARAM_SOURCE_ID, sourceId); - AuthorizationException error = catchThrowableOfType(() -> { + AuthorizationException error = catchThrowableOfType(AuthorizationException.class, () -> { service.importDatum(userId, endpoint.getEndpointId(), type, in, parameters); - }, AuthorizationException.class); + }); // THEN // @formatter:off diff --git a/solarnet/datum/build.gradle b/solarnet/datum/build.gradle index 781bd5bb1..1aa4df113 100644 --- a/solarnet/datum/build.gradle +++ b/solarnet/datum/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/datum/src/test/java/net/solarnetwork/central/datum/export/dest/http/test/HttpDatumExportDestinationServiceTests.java b/solarnet/datum/src/test/java/net/solarnetwork/central/datum/export/dest/http/test/HttpDatumExportDestinationServiceTests.java index ad4445fc3..e9a5c5edf 100644 --- a/solarnet/datum/src/test/java/net/solarnetwork/central/datum/export/dest/http/test/HttpDatumExportDestinationServiceTests.java +++ b/solarnet/datum/src/test/java/net/solarnetwork/central/datum/export/dest/http/test/HttpDatumExportDestinationServiceTests.java @@ -42,7 +42,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import java.util.concurrent.CompletableFuture; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; import org.apache.hc.client5.http.impl.classic.HttpClients; import org.apache.hc.core5.http.ContentType; @@ -56,6 +55,7 @@ import org.eclipse.jetty.server.Response; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.IO; +import org.eclipse.jetty.util.Promise; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -142,7 +142,8 @@ public boolean handle(Request request, Response response, Callback callback) ; // @formatter:on - CompletableFuture f = Content.Source.asStringAsync(request, UTF_8); + var f = new Promise.Completable(); + Content.Source.asString(request, UTF_8, f); f.whenComplete((content, failure) -> { if ( failure == null ) { // @formatter:off @@ -233,7 +234,8 @@ public boolean handle(Request request, Response response, Callback callback) // @formatter:on - CompletableFuture f = Content.Source.asStringAsync(request, UTF_8); + var f = new Promise.Completable(); + Content.Source.asString(request, UTF_8, f); f.whenComplete((content, failure) -> { if ( failure == null ) { // @formatter:off @@ -326,7 +328,10 @@ public boolean handle(Request request, Response response, Callback callback) formData.setFilesDirectory(tmpDir); try { - process(formData.parse(request).join()); + var f = new Promise.Completable(); + var inv = Promise.from(InvocationType.NON_BLOCKING, f); + formData.parse(request, f, inv); + process(f.join()); callback.succeeded(); } catch ( Exception x ) { Response.writeError(request, response, callback, x); @@ -431,7 +436,8 @@ public boolean handle(Request request, Response response, Callback callback) ; // @formatter:on - CompletableFuture f = Content.Source.asStringAsync(request, UTF_8); + var f = new Promise.Completable(); + Content.Source.asString(request, UTF_8, f); f.whenComplete((content, failure) -> { if ( failure == null ) { // @formatter:off diff --git a/solarnet/dnp3/build.gradle b/solarnet/dnp3/build.gradle index 116e6868b..59f39d275 100644 --- a/solarnet/dnp3/build.gradle +++ b/solarnet/dnp3/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/instructor-input/build.gradle b/solarnet/instructor-input/build.gradle index 76b8fcc26..e4c50b7de 100644 --- a/solarnet/instructor-input/build.gradle +++ b/solarnet/instructor-input/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/instructor/build.gradle b/solarnet/instructor/build.gradle index 7aacd0c9f..173685eb9 100644 --- a/solarnet/instructor/build.gradle +++ b/solarnet/instructor/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/net-proxy/build.gradle b/solarnet/net-proxy/build.gradle index 00852b69e..7bb252fbe 100644 --- a/solarnet/net-proxy/build.gradle +++ b/solarnet/net-proxy/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/net-proxy/src/test/java/net/solarnetwork/central/net/proxy/service/impl/test/SimpleDynamicPortRegistrarTests.java b/solarnet/net-proxy/src/test/java/net/solarnetwork/central/net/proxy/service/impl/test/SimpleDynamicPortRegistrarTests.java index f1bf7edae..79f065259 100644 --- a/solarnet/net-proxy/src/test/java/net/solarnetwork/central/net/proxy/service/impl/test/SimpleDynamicPortRegistrarTests.java +++ b/solarnet/net-proxy/src/test/java/net/solarnetwork/central/net/proxy/service/impl/test/SimpleDynamicPortRegistrarTests.java @@ -1,21 +1,21 @@ /* ================================================================== * SimpleDynamicPortRegistrarTests.java - 3/08/2023 6:58:11 am - * + * * Copyright 2023 SolarNetwork.net Dev Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * ================================================================== */ @@ -38,7 +38,7 @@ /** * Test cases for the {@link SimpleDynamicPortRegistrar} class. - * + * * @author matt * @version 1.0 */ @@ -103,9 +103,9 @@ public void allocatePort_fail() { given(portSupplier.get()).willThrow(new RuntimeException("Fail")); // WHEN - catchThrowableOfType(() -> { + catchThrowableOfType(IllegalStateException.class, () -> { service.reserveNewPort(); - }, IllegalStateException.class); + }); // THEN verify(portSupplier, times(retries + 1).description("Supplier called retries + 1 times")).get(); diff --git a/solarnet/ocpp/build.gradle b/solarnet/ocpp/build.gradle index fb17998a9..f5bf87290 100644 --- a/solarnet/ocpp/build.gradle +++ b/solarnet/ocpp/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/oscp-fp/build.gradle b/solarnet/oscp-fp/build.gradle index 5b19ea53a..62c780421 100644 --- a/solarnet/oscp-fp/build.gradle +++ b/solarnet/oscp-fp/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/oscp-fp/src/main/java/net/solarnetwork/central/oscp/fp/config/OAuthClientConfig.java b/solarnet/oscp-fp/src/main/java/net/solarnetwork/central/oscp/fp/config/OAuthClientConfig.java index 34851caeb..e9aa3d57f 100644 --- a/solarnet/oscp-fp/src/main/java/net/solarnetwork/central/oscp/fp/config/OAuthClientConfig.java +++ b/solarnet/oscp-fp/src/main/java/net/solarnetwork/central/oscp/fp/config/OAuthClientConfig.java @@ -37,11 +37,12 @@ import org.springframework.security.oauth2.client.OAuth2AuthorizedClientProvider; import org.springframework.security.oauth2.client.OAuth2AuthorizedClientProviderBuilder; import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService; -import org.springframework.security.oauth2.client.endpoint.DefaultClientCredentialsTokenResponseClient; +import org.springframework.security.oauth2.client.endpoint.RestClientClientCredentialsTokenResponseClient; import org.springframework.security.oauth2.client.http.OAuth2ErrorResponseErrorHandler; import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.security.oauth2.core.http.converter.OAuth2AccessTokenResponseHttpMessageConverter; +import org.springframework.web.client.RestClient; import org.springframework.web.client.RestTemplate; import net.solarnetwork.central.biz.SecretsBiz; import net.solarnetwork.central.oscp.dao.ExternalSystemSupportDao; @@ -92,8 +93,8 @@ public OAuth2AuthorizedClientManager oauthAuthorizedClientManager(ClientRegistra .errorHandler(new OAuth2ErrorResponseErrorHandler()) .build(); // @formatter:on - var client = new DefaultClientCredentialsTokenResponseClient(); - client.setRestOperations(restOps); + var client = new RestClientClientCredentialsTokenResponseClient(); + client.setRestClient(RestClient.create(restOps)); b.accessTokenResponseClient(client); }).build(); diff --git a/solarnet/oscp-fp/src/test/java/net/solarnetwork/central/oscp/fp/biz/dao/test/DaoFlexibilityProviderBizTests.java b/solarnet/oscp-fp/src/test/java/net/solarnetwork/central/oscp/fp/biz/dao/test/DaoFlexibilityProviderBizTests.java index 66fdd0997..631b87878 100644 --- a/solarnet/oscp-fp/src/test/java/net/solarnetwork/central/oscp/fp/biz/dao/test/DaoFlexibilityProviderBizTests.java +++ b/solarnet/oscp-fp/src/test/java/net/solarnetwork/central/oscp/fp/biz/dao/test/DaoFlexibilityProviderBizTests.java @@ -1,21 +1,21 @@ /* ================================================================== * DaoFlexibilityProviderBizTests.java - 17/08/2022 8:26:20 am - * + * * Copyright 2022 SolarNetwork.net Dev Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * ================================================================== */ @@ -125,7 +125,7 @@ /** * Test cases for the {@link DaoFlexibilityProviderBiz} class. - * + * * @author matt * @version 1.0 */ @@ -315,7 +315,7 @@ public void register_cp() throws Exception { .andExpect(method(HttpMethod.POST)) .andExpect(header(AUTHORIZATION, tokenAuthorizationHeader(sysToken))) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(content().json(expectedPostJson, false)).andRespond(withNoContent()); + .andExpect(content().json(expectedPostJson)).andRespond(withNoContent()); // save system versionUrl details given(capacityProviderDao.save(same(cp2))).willReturn(cp2.getId()); @@ -385,7 +385,7 @@ public void register_co() throws Exception { .andExpect(method(HttpMethod.POST)) .andExpect(header(AUTHORIZATION, tokenAuthorizationHeader(sysToken))) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(content().json(expectedPostJson, false)).andRespond(withNoContent()); + .andExpect(content().json(expectedPostJson)).andRespond(withNoContent()); // save system versionUrl details given(capacityOptimizerDao.save(same(co2))).willReturn(co2.getId()); @@ -449,7 +449,7 @@ public void handshake_cp() throws Exception { .andExpect(header(AUTHORIZATION, tokenAuthorizationHeader(sysToken))) .andExpect(header(CORRELATION_ID_HEADER, requestId)) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(content().json(expectedPostJson, false)).andRespond(withNoContent()); + .andExpect(content().json(expectedPostJson)).andRespond(withNoContent()); // WHEN CompletableFuture sysReady = CompletableFuture.completedFuture(null); @@ -506,7 +506,7 @@ public void handshake_co() throws Exception { .andExpect(header(AUTHORIZATION, tokenAuthorizationHeader(sysToken))) .andExpect(header(CORRELATION_ID_HEADER, requestId)) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(content().json(expectedPostJson, false)).andRespond(withNoContent()); + .andExpect(content().json(expectedPostJson)).andRespond(withNoContent()); // WHEN CompletableFuture sysReady = CompletableFuture.completedFuture(null); @@ -603,7 +603,7 @@ public void updateGroupCapacityForecast() throws Exception { .andExpect(header(AUTHORIZATION, tokenAuthorizationHeader(sysToken))) .andExpect(header(REQUEST_ID_HEADER, requestId)) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(content().json(expectedPostJson, false)).andRespond(withNoContent()); + .andExpect(content().json(expectedPostJson)).andRespond(withNoContent()); // WHEN biz.updateGroupCapacityForecast(authInfo, groupIdentifier, requestId, forecast); @@ -659,7 +659,7 @@ public void updateGroupCapacityForecast_customUrl() throws Exception { .andExpect(header(AUTHORIZATION, tokenAuthorizationHeader(sysToken))) .andExpect(header(REQUEST_ID_HEADER, requestId)) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(content().json(expectedPostJson, false)).andRespond(withNoContent()); + .andExpect(content().json(expectedPostJson)).andRespond(withNoContent()); // WHEN biz.updateGroupCapacityForecast(authInfo, groupIdentifier, requestId, forecast); @@ -739,7 +739,7 @@ public void updateGroupCapacityForecast_withSourceId() throws Exception { group.getCapacityProviderId(), group.getCapacityOptimizerId(), group.getIdentifier()))) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(content().json(expectedPostJson, false)).andRespond(withNoContent()); + .andExpect(content().json(expectedPostJson)).andRespond(withNoContent()); // WHEN biz.updateGroupCapacityForecast(authInfo, groupIdentifier, requestId, forecast); @@ -894,7 +894,7 @@ public void adjustGroupCapacityForecast() throws Exception { .andExpect(header(AUTHORIZATION, tokenAuthorizationHeader(sysToken))) .andExpect(header(REQUEST_ID_HEADER, requestId)) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(content().json(expectedPostJson, false)).andRespond(withNoContent()); + .andExpect(content().json(expectedPostJson)).andRespond(withNoContent()); // WHEN biz.adjustGroupCapacityForecast(authInfo, groupIdentifier, requestId, forecast); diff --git a/solarnet/oscp-sim-cp/build.gradle b/solarnet/oscp-sim-cp/build.gradle index 845810ac8..c736b3f9e 100644 --- a/solarnet/oscp-sim-cp/build.gradle +++ b/solarnet/oscp-sim-cp/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/oscp/build.gradle b/solarnet/oscp/build.gradle index 8170c5fbe..df0045d01 100644 --- a/solarnet/oscp/build.gradle +++ b/solarnet/oscp/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/solardin/build.gradle b/solarnet/solardin/build.gradle index 1c9a368c7..0c19753b8 100644 --- a/solarnet/solardin/build.gradle +++ b/solarnet/solardin/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/solardin/src/test/java/net/solarnetwork/central/din/app/security/test/EndpointAuthenticationProviderTests.java b/solarnet/solardin/src/test/java/net/solarnetwork/central/din/app/security/test/EndpointAuthenticationProviderTests.java index 7ed9b0cb5..98c2735a1 100644 --- a/solarnet/solardin/src/test/java/net/solarnetwork/central/din/app/security/test/EndpointAuthenticationProviderTests.java +++ b/solarnet/solardin/src/test/java/net/solarnetwork/central/din/app/security/test/EndpointAuthenticationProviderTests.java @@ -40,8 +40,8 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.WebAuthenticationDetails; -import net.solarnetwork.central.din.app.security.EndpointAuthenticationDetails; import net.solarnetwork.central.din.app.security.DatumEndpointAuthenticationProvider; +import net.solarnetwork.central.din.app.security.EndpointAuthenticationDetails; import net.solarnetwork.central.din.security.AuthenticatedEndpointCredentials; import net.solarnetwork.central.din.security.CredentialAuthorizationDao; @@ -156,8 +156,8 @@ public void auth_badPassword() { given(authDao.credentialsForEndpoint(endpointId, username)).willReturn(details); // WHEN - BadCredentialsException result = catchThrowableOfType(() -> provider.authenticate(auth), - BadCredentialsException.class); + BadCredentialsException result = catchThrowableOfType(BadCredentialsException.class, + () -> provider.authenticate(auth)); // THEN // @formatter:off @@ -182,8 +182,8 @@ public void auth_userNotFound() { given(authDao.credentialsForEndpoint(endpointId, username)).willReturn(null); // WHEN - BadCredentialsException result = catchThrowableOfType(() -> provider.authenticate(auth), - BadCredentialsException.class); + BadCredentialsException result = catchThrowableOfType(BadCredentialsException.class, + () -> provider.authenticate(auth)); // THEN // @formatter:off diff --git a/solarnet/solardnp3/build.gradle b/solarnet/solardnp3/build.gradle index 6115411d3..2830dda05 100644 --- a/solarnet/solardnp3/build.gradle +++ b/solarnet/solardnp3/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/solarflux-vernemq-webhook/build.gradle b/solarnet/solarflux-vernemq-webhook/build.gradle index d57224075..7043c8ef7 100644 --- a/solarnet/solarflux-vernemq-webhook/build.gradle +++ b/solarnet/solarflux-vernemq-webhook/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/solarflux-vernemq-webhook/src/test/java/net/solarnetwork/flux/vernemq/webhook/web/test/AuthHooksControllerTests.java b/solarnet/solarflux-vernemq-webhook/src/test/java/net/solarnetwork/flux/vernemq/webhook/web/test/AuthHooksControllerTests.java index 5269f5fca..ed1a8f7d7 100644 --- a/solarnet/solarflux-vernemq-webhook/src/test/java/net/solarnetwork/flux/vernemq/webhook/web/test/AuthHooksControllerTests.java +++ b/solarnet/solarflux-vernemq-webhook/src/test/java/net/solarnetwork/flux/vernemq/webhook/web/test/AuthHooksControllerTests.java @@ -27,8 +27,8 @@ import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import org.springframework.test.web.servlet.MockMvc; @@ -50,7 +50,7 @@ public class AuthHooksControllerTests extends TestSupport { @Autowired private MockMvc mvc; - @MockBean + @MockitoBean private AuthService authService; @Test diff --git a/solarnet/solarflux-vernemq-webhook/src/test/java/net/solarnetwork/flux/vernemq/webhook/web/test/NonAuthHooksControllerTests.java b/solarnet/solarflux-vernemq-webhook/src/test/java/net/solarnetwork/flux/vernemq/webhook/web/test/NonAuthHooksControllerTests.java index ea8ff2726..011472205 100644 --- a/solarnet/solarflux-vernemq-webhook/src/test/java/net/solarnetwork/flux/vernemq/webhook/web/test/NonAuthHooksControllerTests.java +++ b/solarnet/solarflux-vernemq-webhook/src/test/java/net/solarnetwork/flux/vernemq/webhook/web/test/NonAuthHooksControllerTests.java @@ -34,8 +34,8 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import org.springframework.test.web.servlet.MockMvc; @@ -62,7 +62,7 @@ public class NonAuthHooksControllerTests extends TestSupport { @Autowired private MockMvc mvc; - @MockBean + @MockitoBean private AuditService authService; @Captor diff --git a/solarnet/solarin/build.gradle b/solarnet/solarin/build.gradle index e033b9844..993814d0a 100644 --- a/solarnet/solarin/build.gradle +++ b/solarnet/solarin/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/solarjobs/build.gradle b/solarnet/solarjobs/build.gradle index 431c3167c..62a64b58a 100644 --- a/solarnet/solarjobs/build.gradle +++ b/solarnet/solarjobs/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/solarocpp/build.gradle b/solarnet/solarocpp/build.gradle index e78192a47..c7c2012bf 100644 --- a/solarnet/solarocpp/build.gradle +++ b/solarnet/solarocpp/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/solarquery/build.gradle b/solarnet/solarquery/build.gradle index fb74bcb1b..34033b583 100644 --- a/solarnet/solarquery/build.gradle +++ b/solarnet/solarquery/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } apply plugin: 'java' diff --git a/solarnet/solaruser/build.gradle b/solarnet/solaruser/build.gradle index fa9949cc1..e178d08b1 100644 --- a/solarnet/solaruser/build.gradle +++ b/solarnet/solaruser/build.gradle @@ -2,7 +2,7 @@ plugins { //id 'checkstyle' id 'java' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' } //apply plugin: 'checkstyle' diff --git a/solarnet/user-billing/build.gradle b/solarnet/user-billing/build.gradle index c6eda0d29..5d681a680 100644 --- a/solarnet/user-billing/build.gradle +++ b/solarnet/user-billing/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user-cloud-integrations/build.gradle b/solarnet/user-cloud-integrations/build.gradle index 44808c2fd..f50613b6f 100644 --- a/solarnet/user-cloud-integrations/build.gradle +++ b/solarnet/user-cloud-integrations/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user-cloud-integrations/src/test/java/net/solarnetwork/central/user/c2c/biz/impl/test/DaoUserCloudIntegrationsBizTests.java b/solarnet/user-cloud-integrations/src/test/java/net/solarnetwork/central/user/c2c/biz/impl/test/DaoUserCloudIntegrationsBizTests.java index 027ffd39e..a22798cc1 100644 --- a/solarnet/user-cloud-integrations/src/test/java/net/solarnetwork/central/user/c2c/biz/impl/test/DaoUserCloudIntegrationsBizTests.java +++ b/solarnet/user-cloud-integrations/src/test/java/net/solarnetwork/central/user/c2c/biz/impl/test/DaoUserCloudIntegrationsBizTests.java @@ -820,8 +820,8 @@ public void datumStreamPollTaskEntity_save_invalidState() { // WHEN for ( BasicClaimableJobState state : EnumSet.complementOf(EnumSet.of(Queued, Completed)) ) { input.setState(state); - ValidationException ex = catchThrowableOfType(() -> biz.saveDatumStreamPollTask(pk, input), - ValidationException.class); + ValidationException ex = catchThrowableOfType(ValidationException.class, + () -> biz.saveDatumStreamPollTask(pk, input)); // THEN // @formatter:off diff --git a/solarnet/user-datum-input/build.gradle b/solarnet/user-datum-input/build.gradle index 18de6fe26..b9a346ff1 100644 --- a/solarnet/user-datum-input/build.gradle +++ b/solarnet/user-datum-input/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user-datum/build.gradle b/solarnet/user-datum/build.gradle index ff17b2f7a..ce114c4b9 100644 --- a/solarnet/user-datum/build.gradle +++ b/solarnet/user-datum/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user-dnp3/build.gradle b/solarnet/user-dnp3/build.gradle index 156212af8..09c98dee0 100644 --- a/solarnet/user-dnp3/build.gradle +++ b/solarnet/user-dnp3/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user-instructor-input/build.gradle b/solarnet/user-instructor-input/build.gradle index c1606ec2e..98313a850 100644 --- a/solarnet/user-instructor-input/build.gradle +++ b/solarnet/user-instructor-input/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user-ocpp/build.gradle b/solarnet/user-ocpp/build.gradle index d7e7a6408..083c09b4b 100644 --- a/solarnet/user-ocpp/build.gradle +++ b/solarnet/user-ocpp/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user-oscp/build.gradle b/solarnet/user-oscp/build.gradle index 1333f5085..e4c89bda5 100644 --- a/solarnet/user-oscp/build.gradle +++ b/solarnet/user-oscp/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user/build.gradle b/solarnet/user/build.gradle index f4b85529d..5cad274f3 100644 --- a/solarnet/user/build.gradle +++ b/solarnet/user/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.3.5' apply false + id 'org.springframework.boot' version '3.4.0' apply false } apply plugin: 'java-library' diff --git a/solarnet/user/src/main/java/net/solarnetwork/central/user/pki/dogtag/SSLContextFactory.java b/solarnet/user/src/main/java/net/solarnetwork/central/user/pki/dogtag/SSLContextFactory.java index 5dc3073e2..51a04666c 100644 --- a/solarnet/user/src/main/java/net/solarnetwork/central/user/pki/dogtag/SSLContextFactory.java +++ b/solarnet/user/src/main/java/net/solarnetwork/central/user/pki/dogtag/SSLContextFactory.java @@ -37,13 +37,11 @@ import javax.net.ssl.SSLContext; import org.apache.hc.client5.http.classic.HttpClient; import org.apache.hc.client5.http.impl.classic.HttpClients; -import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager; +import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder; import org.apache.hc.client5.http.io.HttpClientConnectionManager; -import org.apache.hc.client5.http.socket.ConnectionSocketFactory; +import org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy; import org.apache.hc.client5.http.ssl.DefaultHostnameVerifier; -import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory; -import org.apache.hc.core5.http.config.Registry; -import org.apache.hc.core5.http.config.RegistryBuilder; +import org.apache.hc.core5.reactor.ssl.SSLBufferMode; import org.apache.hc.core5.ssl.SSLContexts; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -111,12 +109,13 @@ public RestOperations createRestOps() { enabledProtocols, disabledProtocols); String[] ciphers = filterByEnabledDisabled(ctx.getSupportedSSLParameters().getCipherSuites(), enabledCipherSuites, disabledCipherSuites); - SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(createContext(), protocols, - ciphers, new DefaultHostnameVerifier()); - Registry r = RegistryBuilder. create() - .register("https", sslsf).build(); - HttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(r); + DefaultClientTlsStrategy sslstg = new DefaultClientTlsStrategy(createContext(), protocols, + ciphers, SSLBufferMode.STATIC, new DefaultHostnameVerifier()); + + HttpClientConnectionManager connManager = PoolingHttpClientConnectionManagerBuilder.create() + .setTlsSocketStrategy(sslstg).build(); + HttpClient httpClient = HttpClients.custom().setConnectionManager(connManager).build(); ClientHttpRequestFactory reqFactory = LoggingHttpRequestInterceptor