summaryrefslogtreecommitdiffstats
path: root/main/src/test
diff options
context:
space:
mode:
authorTaka Cho <takamune.cho@att.com>2020-06-18 15:47:37 -0400
committerTaka Cho <takamune.cho@att.com>2020-06-19 08:41:19 -0400
commitd7176ddc79b3af3ca78dafef7383ed05eb93cdda (patch)
tree2819c6f854ea422a9736d408551aa864646f6728 /main/src/test
parentcfa428a43f752a295726ac1d51cad25b2ed3a989 (diff)
xcaml-pdp sonar issue fixes
replace with '<>' and assert statements Issue-ID: POLICY-2616 Change-Id: Id999d3299918491c06918caaa28c44e2148574bc Signed-off-by: Taka Cho <takamune.cho@att.com>
Diffstat (limited to 'main/src/test')
-rw-r--r--main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonMessageBodyHandler.java10
-rw-r--r--main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlMessageBodyHandler.java10
2 files changed, 10 insertions, 10 deletions
diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonMessageBodyHandler.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonMessageBodyHandler.java
index 988c91a0..0b77650c 100644
--- a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonMessageBodyHandler.java
+++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonMessageBodyHandler.java
@@ -82,22 +82,22 @@ public class TestXacmlJsonMessageBodyHandler {
"src/test/resources/decisions/decision.native.request.json"));
assertFalse(req.getCombinedDecision());
assertFalse(req.getReturnPolicyIdList());
- assertTrue(req.getRequestAttributes().size() == 3);
+ assertEquals(3, req.getRequestAttributes().size());
Iterator<RequestAttributes> iter = req.getRequestAttributes().iterator();
RequestAttributes firstRequestAttributes = iter.next();
- assertTrue(firstRequestAttributes.getAttributes().size() == 1);
+ assertEquals(1, firstRequestAttributes.getAttributes().size());
assertEquals("Julius Hibbert", firstRequestAttributes.getAttributes().iterator().next()
.getValues().iterator().next().getValue().toString());
RequestAttributes secondRequestAttributes = iter.next();
- assertTrue(secondRequestAttributes.getAttributes().size() == 1);
+ assertEquals(1, secondRequestAttributes.getAttributes().size());
assertEquals("http://medico.com/record/patient/BartSimpson", secondRequestAttributes.getAttributes()
.iterator().next().getValues().iterator().next().getValue().toString());
RequestAttributes thirdRequestAttributes = iter.next();
- assertTrue(thirdRequestAttributes.getAttributes().size() == 1);
+ assertEquals(1, thirdRequestAttributes.getAttributes().size());
assertEquals("read", thirdRequestAttributes.getAttributes().iterator().next()
.getValues().iterator().next().getValue().toString());
}
-} \ No newline at end of file
+}
diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlMessageBodyHandler.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlMessageBodyHandler.java
index 4ae75387..ba2bd780 100644
--- a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlMessageBodyHandler.java
+++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlMessageBodyHandler.java
@@ -80,22 +80,22 @@ public class TestXacmlXmlMessageBodyHandler {
"src/test/resources/decisions/decision.native.request.xml"));
assertFalse(req.getCombinedDecision());
assertFalse(req.getReturnPolicyIdList());
- assertTrue(req.getRequestAttributes().size() == 4);
+ assertEquals(4, req.getRequestAttributes().size());
Iterator<RequestAttributes> iter = req.getRequestAttributes().iterator();
RequestAttributes firstRequestAttributes = iter.next();
- assertTrue(firstRequestAttributes.getAttributes().size() == 1);
+ assertEquals(1, firstRequestAttributes.getAttributes().size());
assertEquals("Julius Hibbert", firstRequestAttributes.getAttributes().iterator().next()
.getValues().iterator().next().getValue().toString());
RequestAttributes secondRequestAttributes = iter.next();
- assertTrue(secondRequestAttributes.getAttributes().size() == 1);
+ assertEquals(1, secondRequestAttributes.getAttributes().size());
assertEquals("http://medico.com/record/patient/BartSimpson", secondRequestAttributes.getAttributes()
.iterator().next().getValues().iterator().next().getValue().toString());
RequestAttributes thirdRequestAttributes = iter.next();
- assertTrue(thirdRequestAttributes.getAttributes().size() == 1);
+ assertEquals(1, thirdRequestAttributes.getAttributes().size());
assertEquals("read", thirdRequestAttributes.getAttributes().iterator().next()
.getValues().iterator().next().getValue().toString());
}
-} \ No newline at end of file
+}