summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/ApplicationTestV2.java4
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SdncOscA1ClientTest.java11
2 files changed, 7 insertions, 8 deletions
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/ApplicationTestV2.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/ApplicationTestV2.java
index bc47baf9..3a7068d6 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/ApplicationTestV2.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/ApplicationTestV2.java
@@ -500,12 +500,12 @@ class ApplicationTestV2 {
url = "/policy-schemas?ric_id=ric1&policytype_id=type1";
rsp = restClient().get(url).block();
PolicySchemaList list = gson.fromJson(rsp, PolicySchemaList.class);
- assertThat(list.schemas.size()).isEqualTo(1);
+ assertThat(list.schemas).hasSize(1);
url = "/policy-schemas?ric_id=ric1&policytype_id=type2";
rsp = restClient().get(url).block();
list = gson.fromJson(rsp, PolicySchemaList.class);
- assertThat(list.schemas.size()).isEqualTo(0);
+ assertThat(list.schemas).isEmpty();
// Get schema for non existing RIC
url = "/policy-schemas?ric_id=ric1XXX";
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SdncOscA1ClientTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SdncOscA1ClientTest.java
index 1fc4a421..08e99847 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SdncOscA1ClientTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SdncOscA1ClientTest.java
@@ -22,6 +22,7 @@ package org.onap.ccsdk.oran.a1policymanagementservice.clients;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -95,12 +96,10 @@ class SdncOscA1ClientTest {
@Test
void createClientWithWrongProtocol_thenErrorIsThrown() {
- try {
- new SdncOscA1Client(A1ProtocolType.STD_V1_1, null, null, new AsyncRestClient("", null));
- fail("Should have thrown exception.");
- } catch (IllegalArgumentException e) {
- return;
- }
+ AsyncRestClient asyncRestClient = new AsyncRestClient("", null);
+ assertThrows(IllegalArgumentException.class, () -> {
+ new SdncOscA1Client(A1ProtocolType.STD_V1_1, null, null, asyncRestClient);
+ });
}
@Test