summaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src/test
diff options
context:
space:
mode:
authorelinuxhenrik <henrik.b.andersson@est.tech>2020-11-18 11:11:41 +0100
committerelinuxhenrik <henrik.b.andersson@est.tech>2020-11-18 12:57:48 +0100
commitc4f262ad3492b4c159a8250eebc8375e8dc55874 (patch)
tree2aca995f99f0367a084fa62be7c6b8e706f04a1a /a1-policy-management/src/test
parenta7af96db46c35c091b4a6c082fb36bd7ece86a40 (diff)
Remove Sonar code smells
Change-Id: I0a9b8624eda84d74b0f7f00a4981917255744d26 Issue-ID: CCSDK-2966 Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
Diffstat (limited to 'a1-policy-management/src/test')
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java2
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java3
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java2
3 files changed, 5 insertions, 2 deletions
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java
index 83b73d18..e6834e77 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/MockPolicyManagementService.java
@@ -60,6 +60,8 @@ import org.springframework.util.StringUtils;
@TestPropertySource(properties = { //
"server.ssl.key-store=./config/keystore.jks", //
"app.webclient.trust-store=./config/truststore.jks"})
+@SuppressWarnings("java:S3577") // Class name should start or end with Test. This is not a test class per se, but a mock
+ // of the server.
class MockPolicyManagementService {
private static final Logger logger = LoggerFactory.getLogger(MockPolicyManagementService.class);
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java
index 985ce558..ced739ad 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java
@@ -84,8 +84,9 @@ class CcsdkA1AdapterClientTest {
@Test
void createClientWithWrongProtocol_thenErrorIsThrown() {
+ AsyncRestClient asyncRestClient = new AsyncRestClient("", null, null);
assertThrows(IllegalArgumentException.class, () -> {
- new CcsdkA1AdapterClient(A1ProtocolType.STD_V1_1, null, null, new AsyncRestClient("", null, null));
+ new CcsdkA1AdapterClient(A1ProtocolType.STD_V1_1, null, null, asyncRestClient);
});
}
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 5e089a0b..516ddd5f 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
@@ -680,7 +680,7 @@ class ApplicationTest {
doReturn(Mono.error(a1Exception)).when(a1Client).getPolicyStatus(any());
rsp = restClient().get(url).block();
info = gson.fromJson(rsp, PolicyStatusInfo.class);
- assertThat(info.status.toString()).isEqualTo("{}");
+ assertThat(info.status).hasToString("{}");
}
@Test