aboutsummaryrefslogtreecommitdiffstats
path: root/applications/monitoring/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/monitoring/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/monitoring/src')
-rw-r--r--applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java b/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java
index bdb8a343..fd6711d4 100644
--- a/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java
+++ b/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java
@@ -172,7 +172,7 @@ public class MonitoringPdpApplicationTest {
LOGGER.info("Decision {}", decision);
assertThat(decision.getKey()).isNotNull();
- assertThat(decision.getKey().getPolicies()).hasSize(0);
+ assertThat(decision.getKey().getPolicies()).isEmpty();
//
// Test the branch for query params, and we have no policy anyway
//
@@ -181,7 +181,7 @@ public class MonitoringPdpApplicationTest {
LOGGER.info("Decision {}", decision);
assertThat(decision.getKey()).isNotNull();
- assertThat(decision.getKey().getPolicies()).hasSize(0);
+ assertThat(decision.getKey().getPolicies()).isEmpty();
//
// Test the branch for query params, and we have no policy anyway
//
@@ -190,7 +190,7 @@ public class MonitoringPdpApplicationTest {
LOGGER.info("Decision {}", decision);
assertThat(decision.getKey()).isNotNull();
- assertThat(decision.getKey().getPolicies()).hasSize(0);
+ assertThat(decision.getKey().getPolicies()).isEmpty();
}
@SuppressWarnings("unchecked")
@@ -244,8 +244,7 @@ public class MonitoringPdpApplicationTest {
assertThat(decision.getKey()).isNotNull();
assertThat(decision.getKey().getPolicies()).hasSize(1);
jsonPolicy = (Map<String, Object>) decision.getKey().getPolicies().get("onap.scaleout.tca");
- assertThat(jsonPolicy).isNotNull();
- assertThat(jsonPolicy).doesNotContainKey("properties");
+ assertThat(jsonPolicy).isNotNull().doesNotContainKey("properties");
//
// Don't Ask for abbreviated results
//
@@ -290,7 +289,7 @@ public class MonitoringPdpApplicationTest {
LOGGER.info("Decision {}", decision.getKey());
assertThat(decision.getKey()).isNotNull();
- assertThat(decision.getKey().getPolicies()).hasSize(0);
+ assertThat(decision.getKey().getPolicies()).isEmpty();
}
}