Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 8b82473
Author: Matt Magoffin <[email protected]>
Date:   Wed Nov 27 09:32:52 2024 +1300

    Fix deprecation.

commit c32fb49
Author: Matt Magoffin <[email protected]>
Date:   Wed Nov 27 09:14:48 2024 +1300

    Fix deprecation.

commit 78bbdce
Author: Matt Magoffin <[email protected]>
Date:   Wed Nov 27 08:19:37 2024 +1300

    Fix deprecation.

commit 66fe845
Author: Matt Magoffin <[email protected]>
Date:   Wed Nov 27 07:58:40 2024 +1300

    Fix deprecation.

commit 7ee828c
Author: Matt Magoffin <[email protected]>
Date:   Wed Nov 27 07:55:58 2024 +1300

    Fix deprecation.

commit 30d54d0
Author: Matt Magoffin <[email protected]>
Date:   Wed Nov 27 07:38:42 2024 +1300

    Fix deprecation.

commit 0146aaf
Author: Matt Magoffin <[email protected]>
Date:   Wed Nov 27 07:36:52 2024 +1300

    Fix deprecation.

commit bce4126
Author: Matt Magoffin <[email protected]>
Date:   Wed Nov 27 07:25:04 2024 +1300

    Update to Spring Boot 3.4.
  • Loading branch information
msqr committed Nov 26, 2024
1 parent 6061ef0 commit 1694e93
Show file tree
Hide file tree
Showing 45 changed files with 111 additions and 104 deletions.
1 change: 1 addition & 0 deletions solarnet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions solarnet/cloud-integrations/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -64,7 +64,7 @@ dependencies {

// Testing
testImplementation project(':solarnet-common-test')
testImplementation 'com.squareup.okhttp3:mockwebserver'
testImplementation "com.squareup.okhttp3:mockwebserver:${okhttp3Mockwebserver}"
}

jar.manifest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public OAuth2AuthorizedClientManager alsoEnergyOauthAuthorizedClientManager(

// @formatter:off
var authRestOps = new RestTemplateBuilder()
.requestFactory(t -> reqFactory)
.requestFactory(() -> reqFactory)
.messageConverters(Arrays.asList(
new FormHttpMessageConverter(),
tokenResponseConverter))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
2 changes: 1 addition & 1 deletion solarnet/common-test/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion solarnet/common/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion solarnet/commons-multipart/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

}
2 changes: 1 addition & 1 deletion solarnet/datum-input/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion solarnet/datum/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -142,7 +142,8 @@ public boolean handle(Request request, Response response, Callback callback)
;
// @formatter:on

CompletableFuture<String> f = Content.Source.asStringAsync(request, UTF_8);
var f = new Promise.Completable<String>();
Content.Source.asString(request, UTF_8, f);
f.whenComplete((content, failure) -> {
if ( failure == null ) {
// @formatter:off
Expand Down Expand Up @@ -233,7 +234,8 @@ public boolean handle(Request request, Response response, Callback callback)

// @formatter:on

CompletableFuture<String> f = Content.Source.asStringAsync(request, UTF_8);
var f = new Promise.Completable<String>();
Content.Source.asString(request, UTF_8, f);
f.whenComplete((content, failure) -> {
if ( failure == null ) {
// @formatter:off
Expand Down Expand Up @@ -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<MultiPartFormData.Parts>();
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);
Expand Down Expand Up @@ -431,7 +436,8 @@ public boolean handle(Request request, Response response, Callback callback)
;
// @formatter:on

CompletableFuture<String> f = Content.Source.asStringAsync(request, UTF_8);
var f = new Promise.Completable<String>();
Content.Source.asString(request, UTF_8, f);
f.whenComplete((content, failure) -> {
if ( failure == null ) {
// @formatter:off
Expand Down
2 changes: 1 addition & 1 deletion solarnet/dnp3/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion solarnet/instructor-input/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion solarnet/instructor/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion solarnet/net-proxy/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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
* ==================================================================
*/
Expand All @@ -38,7 +38,7 @@

/**
* Test cases for the {@link SimpleDynamicPortRegistrar} class.
*
*
* @author matt
* @version 1.0
*/
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion solarnet/ocpp/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion solarnet/oscp-fp/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down
Loading

0 comments on commit 1694e93

Please sign in to comment.