summaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src
diff options
context:
space:
mode:
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);