aboutsummaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src
diff options
context:
space:
mode:
authorPatrikBuhr <patrik.buhr@est.tech>2023-01-16 15:27:10 +0100
committerPatrikBuhr <patrik.buhr@est.tech>2023-01-19 09:21:45 +0100
commitaee111025016696c6aa5ffe1f86acdb731a7ff0f (patch)
tree79abf2c001cbb46b499aab553aa9251f94bc86a9 /a1-policy-management/src
parentc0218ada67784a7d5c3a488303bcbab2b3dce5b5 (diff)
Changes needed for springboot version 2.7.7
Change-Id: Ie13ba28d3d9bf62a7851145ab84d3a1509d84261 Issue-ID: CCSDK-3841 Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Diffstat (limited to 'a1-policy-management/src')
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java4
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfigParser.java4
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFile.java6
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/Meters.java2
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java3
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java4
6 files changed, 6 insertions, 17 deletions
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
index 6dbf318d..796d6ad9 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
@@ -27,8 +27,6 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import javax.validation.constraints.NotEmpty;
-
import lombok.Getter;
import org.onap.ccsdk.oran.a1policymanagementservice.configuration.WebClientConfig.HttpProxyConfig;
@@ -41,7 +39,7 @@ import reactor.netty.transport.ProxyProvider;
@EnableConfigurationProperties
public class ApplicationConfig {
- @NotEmpty
+
@Getter
@Value("${app.filepath}")
private String localConfigurationFilePath;
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfigParser.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfigParser.java
index 3990bc7b..6c178d36 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfigParser.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfigParser.java
@@ -39,8 +39,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import javax.validation.constraints.NotNull;
-
import lombok.Builder;
import lombok.Getter;
@@ -249,7 +247,7 @@ public class ApplicationConfigParser {
return getAsString(dmaapInfo, "topic_url");
}
- private static @NotNull String getAsString(JsonObject obj, String memberName) throws ServiceException {
+ private static String getAsString(JsonObject obj, String memberName) throws ServiceException {
return get(obj, memberName).getAsString();
}
}
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFile.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFile.java
index 9db66202..efe2fa2e 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFile.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFile.java
@@ -33,11 +33,8 @@ import java.io.InputStreamReader;
import java.lang.invoke.MethodHandles;
import java.util.Optional;
-import javax.validation.constraints.NotNull;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
@@ -47,7 +44,6 @@ public class ConfigurationFile {
final ApplicationConfig appConfig;
final Gson gson = new Gson();
- @Autowired
public ConfigurationFile(ApplicationConfig appConfig) {
this.appConfig = appConfig;
}
@@ -93,7 +89,7 @@ public class ConfigurationFile {
return JsonParser.parseReader(new InputStreamReader(inputStream));
}
- private InputStream createInputStream(@NotNull String filepath) throws IOException {
+ private InputStream createInputStream(String filepath) throws IOException {
return new BufferedInputStream(new FileInputStream(filepath));
}
}
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/Meters.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/Meters.java
index 203bfacc..c53b1ee9 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/Meters.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/Meters.java
@@ -25,7 +25,6 @@ import io.micrometer.core.instrument.MeterRegistry;
import org.onap.ccsdk.oran.a1policymanagementservice.repository.Policies;
import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyTypes;
import org.onap.ccsdk.oran.a1policymanagementservice.repository.Rics;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
@@ -36,7 +35,6 @@ import org.springframework.stereotype.Component;
@Component
public class Meters {
- @Autowired
public Meters(Rics rics, PolicyTypes policyTypes, Policies policies, MeterRegistry meterRegistry) {
meterRegistry.gauge("total_ric_count", rics, Rics::size);
meterRegistry.gauge("total_policy_type_count", policyTypes, PolicyTypes::size);
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
index 1e8278a9..ec65e4c1 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
@@ -31,7 +31,6 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.PrintStream;
import java.lang.invoke.MethodHandles;
import java.nio.charset.StandardCharsets;
@@ -233,7 +232,7 @@ class ApplicationTest {
}
@Test
- void generateApiDoc() throws IOException {
+ void generateApiDoc() throws Exception {
String url = "https://localhost:" + this.port + "/v3/api-docs";
ResponseEntity<String> resp = restClient("", false).getForEntity(url).block();
assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
index ae4e92bc..b17cc98b 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
@@ -149,8 +149,8 @@ class RicSynchronizationTaskTest {
setUpCreationOfA1Client();
simulateRicWithNoPolicyTypes();
policies.put(policy1);
- WebClientRequestException exception =
- new WebClientRequestException(new ServiceException("x"), null, null, null);
+ WebClientRequestException exception = new WebClientRequestException(new ServiceException("x"), null, null,
+ new org.springframework.http.HttpHeaders());
when(a1ClientMock.deleteAllPolicies(anySet())).thenReturn(Flux.error(exception));
ric1.setState(RicState.AVAILABLE);
runSynch(ric1);