Upgrade preferences to Spring Boot 3 47/135547/2
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Mon, 24 Jul 2023 12:51:13 +0000 (12:51 +0000)
committerFiete Ostkamp <fiete.ostkamp@telekom.de>
Tue, 25 Jul 2023 14:06:19 +0000 (14:06 +0000)
Issue-ID: PORTALNG-25
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: I6b057a9ad4518c507406282cd9d095860017a0cf

app/build.gradle
app/src/main/java/org/onap/portal/prefs/configuration/PortalPrefsConfig.java
app/src/main/java/org/onap/portal/prefs/controller/PreferencesController.java
app/src/main/java/org/onap/portal/prefs/util/Logger.java
app/src/test/resources/application.yml
openapi/build.gradle
settings.gradle

index a640b59..1d51c30 100644 (file)
@@ -37,9 +37,9 @@ repositories {
 ext {
     problemVersion = '0.27.1'
     logstashLogbackVersion = '7.2'
-               embedMongoVersion = '3.2.8'
-               embedMongoIntegrationVersion = '1.1.0-spring27x'
-    springCloudWiremockVersion = '3.1.0'
+       embedMongoVersion = '4.7.0'
+       embedMongoIntegrationVersion = '4.7.0'
+    springCloudWiremockVersion = '4.0.3'
 }
 
 dependencies {
@@ -65,7 +65,7 @@ dependencies {
        testImplementation 'io.rest-assured:rest-assured'
        testImplementation "org.springframework.cloud:spring-cloud-contract-wiremock:$springCloudWiremockVersion"
        testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo:$embedMongoVersion"
-       testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo.spring:$embedMongoIntegrationVersion"
+       testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo.spring30x:$embedMongoIntegrationVersion"
        testCompileOnly 'org.projectlombok:lombok'
        testAnnotationProcessor 'org.projectlombok:lombok'
 }
index 3c03673..2d415cd 100644 (file)
 
 package org.onap.portal.prefs.configuration;
 
-import javax.validation.constraints.NotBlank;
-
 import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.ConstructorBinding;
 
+import jakarta.validation.constraints.NotBlank;
 import lombok.Data;
 
 @Data
-@ConstructorBinding
 @ConfigurationProperties("portal-prefs")
 public class PortalPrefsConfig {
 
index 510ef37..f2ae7f9 100644 (file)
  */
 
 package org.onap.portal.prefs.controller;
-
-
-import javax.validation.Valid;
-
 import org.onap.portal.prefs.exception.ProblemException;
 import org.onap.portal.prefs.openapi.api.PreferencesApi;
 import org.onap.portal.prefs.openapi.model.Preferences;
index 4f4ac6c..4026b9f 100644 (file)
 
 package org.onap.portal.prefs.util;
 
-import lombok.extern.slf4j.Slf4j;
+import java.net.URI;
+
 import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
+import org.springframework.http.HttpStatusCode;
 
-import java.net.URI;
+import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
 public class Logger {
@@ -36,8 +37,8 @@ public class Logger {
     log.info("Portal-prefs - request - X-Request-Id {} {} {}", xRequestId, methode, path);
   }
 
-  public static void responseLog(String xRequestId, HttpStatus code) {
-    log.info("Portal-prefs - response - X-Request-Id {} {}", xRequestId, code);
+  public static void responseLog(String xRequestId, HttpStatusCode httpStatusCode) {
+    log.info("Portal-prefs - response - X-Request-Id {} {}", xRequestId, httpStatusCode);
   }
 
   public static void errorLog(String xRequestId, String msg, String id, String app) {
index 3316c0d..bdfadf4 100644 (file)
@@ -2,10 +2,13 @@ server:
   port: 9001
   address: 0.0.0.0
 
+de:
+  flapdoodle:
+    mongodb:
+      embedded:
+        version: 5.0.15
+
 spring:
-  mongodb:
-    embedded:
-      version: 3.2.8
   jackson:
     serialization:
       # needed for serializing objects of type object
index 11c0592..7b7775a 100644 (file)
@@ -9,8 +9,9 @@ repositories {
 }
 
 dependencies {
-       implementation 'org.openapitools:openapi-generator:6.6.0'
-       implementation 'org.springframework.boot:spring-boot-starter-webflux:2.7.3'
+       implementation 'org.openapitools:openapi-generator:7.0.0-beta'
+       implementation 'org.springframework.boot:spring-boot-starter-webflux:3.1.2'
+    implementation 'jakarta.validation:jakarta.validation-api:3.0.2'
 
     constraints {
         implementation('io.swagger.core.v3:swagger-annotations:2.2.5') {
@@ -33,7 +34,8 @@ openApiGenerate {
                interfaceOnly: "true",
                useTags: "true",
                useOptional: "true",
-               reactive: "true"
+               reactive: "true",
+        useSpringBoot3: "true"
     ]
     generateApiTests = false
     generateApiDocumentation = false
index 5477589..1c146af 100644 (file)
@@ -3,11 +3,11 @@ pluginManagement {
     // https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_version_management
     plugins {
         id 'io.spring.dependency-management' version '1.0.13.RELEASE'
-        id 'org.springframework.boot' version '2.7.3'
+        id 'org.springframework.boot' version '3.1.2'
         id 'org.sonarqube' version '3.4.0.2513'
         id 'com.github.hierynomus.license' version '0.16.1'
         id 'com.gorylenko.gradle-git-properties' version '2.4.1'
-        id 'org.openapi.generator' version '6.6.0'
+        id 'org.openapi.generator' version '7.0.0-beta'
     }
     // https://docs.gradle.org/current/userguide/plugins.html#sec:custom_plugin_repositories
     repositories {