chore: update spring boot to v3.3.10 69/140669/1
authorbenzelleroehr <ben.zelleroehr@telekom.de>
Wed, 9 Apr 2025 09:28:28 +0000 (11:28 +0200)
committerbenzelleroehr <ben.zelleroehr@telekom.de>
Wed, 9 Apr 2025 09:31:15 +0000 (11:31 +0200)
Issue-ID: PORTALNG-140
Change-Id: I99189f316af728ad4b2700d6b12191df31d0ead0
Signed-off-by: benzelleroehr <ben.zelleroehr@telekom.de>
app/build.gradle
app/src/main/java/org/onap/portalng/preferences/configuration/SecurityConfig.java
app/src/test/java/org/onap/portalng/preferences/BaseIntegrationTest.java
app/src/test/java/org/onap/portalng/preferences/TokenGenerator.java
app/src/test/java/org/onap/portalng/preferences/preferences/PreferencesControllerIntegrationTest.java
openapi/build.gradle
settings.gradle

index 9df2f3f..8fa1db6 100644 (file)
@@ -45,7 +45,7 @@ repositories {
 ext {
   problemVersion = '0.27.1'
   logstashLogbackVersion = '7.2'
-  springCloudWiremockVersion = '4.0.3'
+  springCloudWiremockVersion = '4.1.5'
   micrometerVersion = '1.0.0'
   liquibaseCoreVersion = '4.31.0'
 }
index 31866fe..b3eb1b7 100644 (file)
@@ -38,16 +38,14 @@ public class SecurityConfig {
 
   @Bean
   public SecurityWebFilterChain springSecurityWebFilterChain(ServerHttpSecurity http) {
-    return http.httpBasic().disable()
-        .formLogin().disable()
-        .csrf().disable()
-        .cors()
-        .and()
-        .authorizeExchange()
-        .pathMatchers(HttpMethod.GET, "/actuator/**").permitAll()
-        .anyExchange().authenticated()
-        .and()
-        .oauth2ResourceServer(ServerHttpSecurity.OAuth2ResourceServerSpec::jwt)
-        .build();
+    return http.httpBasic(basic -> basic.disable()
+            .formLogin(login -> login.disable()
+                    .csrf(csrf -> csrf.disable()
+                            .cors())))
+            .authorizeExchange(exchange -> exchange
+                    .pathMatchers(HttpMethod.GET, "/actuator/**").permitAll()
+                    .anyExchange().authenticated())
+            .oauth2ResourceServer(ServerHttpSecurity.OAuth2ResourceServerSpec::jwt)
+            .build();
   }
 }
index cd5aac4..989bc5b 100644 (file)
@@ -68,7 +68,7 @@ public abstract class BaseIntegrationTest {
     WireMock.stubFor(
         WireMock.get(
                 WireMock.urlMatching(
-                    String.format("/realms/%s/protocol/openid-connect/certs", realm)))
+                        "/realms/%s/protocol/openid-connect/certs".formatted(realm)))
             .willReturn(
                 WireMock.aResponse()
                     .withHeader("Content-Type", JWKSet.MIME_TYPE)
@@ -80,7 +80,7 @@ public abstract class BaseIntegrationTest {
     WireMock.stubFor(
         WireMock.post(
                 WireMock.urlMatching(
-                    String.format("/realms/%s/protocol/openid-connect/token", realm)))
+                        "/realms/%s/protocol/openid-connect/token".formatted(realm)))
             .withBasicAuth("test", "test")
             .withRequestBody(WireMock.containing("grant_type=client_credentials"))
             .willReturn(
index 3dbf110..246aeb2 100644 (file)
@@ -124,7 +124,7 @@ public class TokenGenerator {
     @Builder.Default private final List<String> roles = Collections.emptyList();
 
     public String issuer() {
-      return String.format("http://localhost:%d/realms/%s", port, realm);
+      return "http://localhost:%d/realms/%s".formatted(port, realm);
     }
   }
 }
index f446a9a..213ca27 100644 (file)
@@ -82,11 +82,13 @@ class PreferencesControllerIntegrationTest extends BaseIntegrationTest {
     @Test
     void thatUserPreferencesCanBeSaved() {
         Preferences expectedResponse = new Preferences()
-            .properties("{\n" +
-                "    \"properties\": { \"appStarter\": \"value1\",\n" +
-                "    \"dashboard\": {\"key1:\" : \"value2\"}\n" +
-                "    } \n" +
-                "}");
+            .properties("""
+                {
+                    "properties": { "appStarter": "value1",
+                    "dashboard": {"key1:" : "value2"}
+                    }\s
+                }\
+                """);
         Preferences actualResponse = requestSpecification()
             .given()
             .accept(MediaType.APPLICATION_JSON_VALUE)
@@ -109,21 +111,25 @@ class PreferencesControllerIntegrationTest extends BaseIntegrationTest {
     void thatUserPreferencesCanBeUpdated() {
         // First save a user preference before a GET can run
         Preferences initialPreferences = new Preferences()
-            .properties("{\n" +
-                "    \"properties\": { \"appStarter\": \"value1\",\n" +
-                "    \"dashboard\": {\"key1:\" : \"value2\"}\n" +
-                "    } \n" +
-                "}");
+            .properties("""
+                {
+                    "properties": { "appStarter": "value1",
+                    "dashboard": {"key1:" : "value2"}
+                    }\s
+                }\
+                """);
         preferencesService
             .savePreferences(X_REQUEST_ID,"test-user", initialPreferences)
             .block();
 
         Preferences expectedResponse = new Preferences()
-            .properties("{\n" +
-                "    \"properties\": { \"appStarter\": \"value3\",\n" +
-                "    \"dashboard\": {\"key2:\" : \"value4\"}\n" +
-                "    } \n" +
-                "}");
+            .properties("""
+                {
+                    "properties": { "appStarter": "value3",
+                    "dashboard": {"key2:" : "value4"}
+                    }\s
+                }\
+                """);
         Preferences actualResponse = requestSpecification("test-user")
             .given()
             .accept(MediaType.APPLICATION_JSON_VALUE)
index 61358ee..7594398 100644 (file)
@@ -10,7 +10,7 @@ repositories {
 
 dependencies {
        compileOnly 'org.openapitools:openapi-generator:7.0.0-beta'
-       compileOnly 'org.springframework.boot:spring-boot-starter-webflux:3.1.2'
+       compileOnly 'org.springframework.boot:spring-boot-starter-webflux:3.3.10'
     compileOnly 'jakarta.validation:jakarta.validation-api:3.0.2'
 
     constraints {
@@ -57,3 +57,6 @@ sourceSets {
         }
     }
 }
+tasks.withType(Test).configureEach {
+    useJUnitPlatform()
+}
index 632c8ef..f6cbd54 100644 (file)
@@ -2,8 +2,8 @@
 pluginManagement {
     // https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_version_management
     plugins {
-        id 'io.spring.dependency-management' version '1.1.2'
-        id 'org.springframework.boot' version '3.1.2'
+        id 'io.spring.dependency-management' version '1.1.7'
+        id 'org.springframework.boot' version '3.3.10'
         id 'com.github.hierynomus.license' version '0.16.1'
         id 'com.gorylenko.gradle-git-properties' version '2.4.1'
         id 'org.openapi.generator' version '7.0.0-beta'