aboutsummaryrefslogtreecommitdiffstats
path: root/applications/naming/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-29 14:13:14 -0400
committerJim Hahn <jrh3@att.com>2020-06-29 14:58:33 -0400
commit05506483dff28c491522beeaaea0f6904077e3ed (patch)
tree9146aba8b5f48b693d02ac1846b98e617931bc93 /applications/naming/src
parentf92147f681bac8292021028d88c913ff977dd594 (diff)
Fix issues in xacml-pdp for new sonar rules
Addressed issues reported due to updates to the sonar rules: - invoke only one method in a junit lambda - complete the assertion - use assertThat().exists(), canRead(), etc. Issue-ID: POLICY-2681 Change-Id: I2935f4d0295244ab3b11a57a3bc401c64b695fd1 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'applications/naming/src')
-rw-r--r--applications/naming/src/test/java/org/onap/policy/xacml/pdp/application/naming/NamingPdpApplicationTest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/applications/naming/src/test/java/org/onap/policy/xacml/pdp/application/naming/NamingPdpApplicationTest.java b/applications/naming/src/test/java/org/onap/policy/xacml/pdp/application/naming/NamingPdpApplicationTest.java
index 0077d0b9..85b182cd 100644
--- a/applications/naming/src/test/java/org/onap/policy/xacml/pdp/application/naming/NamingPdpApplicationTest.java
+++ b/applications/naming/src/test/java/org/onap/policy/xacml/pdp/application/naming/NamingPdpApplicationTest.java
@@ -176,7 +176,7 @@ public class NamingPdpApplicationTest {
LOGGER.info("Decision {}", decision.getKey());
assertThat(decision.getKey()).isNotNull();
- assertThat(decision.getKey().getPolicies().size()).isEqualTo(0);
+ assertThat(decision.getKey().getPolicies()).isEmpty();
}
@Test
@@ -194,7 +194,7 @@ public class NamingPdpApplicationTest {
// There is no default policy
//
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(0);
+ assertThat(response.getPolicies()).isEmpty();
//
// Ask for VNF
//
@@ -204,7 +204,7 @@ public class NamingPdpApplicationTest {
//
response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(1);
+ assertThat(response.getPolicies()).hasSize(1);
//
// Validate it
//
@@ -227,7 +227,7 @@ public class NamingPdpApplicationTest {
LOGGER.info("Decision Returned Policy {}", entrySet.getKey());
assertThat(entrySet.getValue()).isInstanceOf(Map.class);
Map<String, Object> policyContents = (Map<String, Object>) entrySet.getValue();
- assertThat(policyContents.containsKey("properties")).isTrue();
+ assertThat(policyContents).containsKey("properties");
assertThat(policyContents.get("properties")).isInstanceOf(Map.class);
Map<String, Object> policyProperties = (Map<String, Object>) policyContents.get("properties");