Upgrade Spring Boot and Spring Cloud versions 97/117397/2
authorMaciej Malewski <maciej.malewski@nokia.com>
Wed, 3 Feb 2021 09:45:43 +0000 (10:45 +0100)
committerMaciej Malewski <maciej.malewski@nokia.com>
Wed, 3 Feb 2021 11:04:35 +0000 (12:04 +0100)
Spring Boot from 2.2.4.RELEASE to 2.4.2
Spring Cloud from Greenwich.SR1 to 2020.0.1

Issue-ID: DCAEGEN2-2537
Signed-off-by: Maciej Malewski <maciej.malewski@nokia.com>
Change-Id: I51c8c450133a68435799802f548bb16ba562550c

pom.xml
prh-app-server/pom.xml
prh-app-server/src/main/java/org/onap/dcaegen2/services/bootstrap/CbsPropertySourceLocator.java
prh-app-server/src/test/java/org/onap/dcaegen2/services/bootstrap/CbsPropertySourceLocatorTest.java
prh-commons/pom.xml

diff --git a/pom.xml b/pom.xml
index 00c683c..28f5c32 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
   ~ ============LICENSE_START=======================================================
   ~ PNF-REGISTRATION-HANDLER
   ~ ================================================================================
-  ~ Copyright (C) 2018-2020 NOKIA Intellectual Property. All rights reserved.
+  ~ Copyright (C) 2018-2021 NOKIA Intellectual Property. All rights reserved.
   ~ ================================================================================
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
@@ -47,8 +47,8 @@
 
   <properties>
     <java.version>11</java.version>
-    <spring-boot.version>2.2.4.RELEASE</spring-boot.version>
-    <spring-cloud.version>Greenwich.SR1</spring-cloud.version>
+    <spring-boot.version>2.4.2</spring-boot.version>
+    <spring-cloud.version>2020.0.1</spring-cloud.version>
     <springfox.version>3.0.0</springfox.version>
     <immutables.version>2.7.5</immutables.version>
     <sdk.version>1.4.3</sdk.version>
index 630a008..aaaf47b 100644 (file)
@@ -3,7 +3,7 @@
   ~ ============LICENSE_START=======================================================
   ~ PNF-REGISTRATION-HANDLER
   ~ ================================================================================
-  ~ Copyright (C) 2018-2020 NOKIA Intellectual Property. All rights reserved.
+  ~ Copyright (C) 2018-2021 NOKIA Intellectual Property. All rights reserved.
   ~ ================================================================================
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
       <groupId>org.springframework.cloud</groupId>
       <artifactId>spring-cloud-starter-config</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-starter-bootstrap</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
index 7b66020..c068988 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * PNF-REGISTRATION-HANDLER
  * ================================================================================
- * Copyright (C) 2019 NOKIA Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 NOKIA Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@ import org.springframework.cloud.bootstrap.config.PropertySourceLocator;
 import org.springframework.core.env.Environment;
 import org.springframework.core.env.MapPropertySource;
 import org.springframework.core.env.PropertySource;
+import reactor.util.retry.Retry;
 
 import java.util.Map;
 
@@ -63,9 +64,9 @@ public class CbsPropertySourceLocator implements PropertySourceLocator {
         Map<String, Object> properties = cbsClientFactoryFacade.createCbsClient(cbsClientConfiguration)
                 .flatMap(cbsClient -> cbsClient.get(CbsRequests.getAll(RequestDiagnosticContext.create())))
                 .doOnError(e -> LOGGER.warn("Failed fetching config properties from CBS - retrying...", e))
-                .retryBackoff(cbsProperties.getFetchRetries().getMaxAttempts(),
-                        cbsProperties.getFetchRetries().getFirstBackoff(),
-                        cbsProperties.getFetchRetries().getMaxBackoff())
+                .retryWhen(Retry.
+                        backoff(cbsProperties.getFetchRetries().getMaxAttempts(), cbsProperties.getFetchRetries().getFirstBackoff()).
+                        maxBackoff(cbsProperties.getFetchRetries().getMaxBackoff()))
                 .doOnNext(this::updateCbsConfig)
                 .map(cbsJsonToPropertyMapConverter::convertToMap)
                 .block();
index faf1867..22a11ed 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * PNF-REGISTRATION-HANDLER
  * ================================================================================
- * Copyright (C) 2019 NOKIA Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 NOKIA Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ class CbsPropertySourceLocatorTest {
 
     @BeforeEach
     void setup() {
-        virtualTimeScheduler = VirtualTimeScheduler.getOrSet();
+        virtualTimeScheduler = VirtualTimeScheduler.getOrSet(true);
 
         when(cbsClientConfigurationResolver.resolveCbsClientConfiguration()).thenReturn(cbsClientConfiguration);
         when(cbsClientFactoryFacade.createCbsClient(cbsClientConfiguration)).thenReturn(Mono.just(cbsClient));
index a9b94bf..096253b 100644 (file)
@@ -3,7 +3,7 @@
   ~ ============LICENSE_START=======================================================
   ~ PNF-REGISTRATION-HANDLER
   ~ ================================================================================
-  ~ Copyright (C) 2018-2019 NOKIA Intellectual Property. All rights reserved.
+  ~ Copyright (C) 2018-2021 NOKIA Intellectual Property. All rights reserved.
   ~ ================================================================================
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.