diff options
author | Taka Cho <takamune.cho@att.com> | 2020-06-18 15:47:37 -0400 |
---|---|---|
committer | Taka Cho <takamune.cho@att.com> | 2020-06-19 08:41:19 -0400 |
commit | d7176ddc79b3af3ca78dafef7383ed05eb93cdda (patch) | |
tree | 2819c6f854ea422a9736d408551aa864646f6728 /main/src/test | |
parent | cfa428a43f752a295726ac1d51cad25b2ed3a989 (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')
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 +} |