From d7176ddc79b3af3ca78dafef7383ed05eb93cdda Mon Sep 17 00:00:00 2001 From: Taka Cho Date: Thu, 18 Jun 2020 15:47:37 -0400 Subject: xcaml-pdp sonar issue fixes replace with '<>' and assert statements Issue-ID: POLICY-2616 Change-Id: Id999d3299918491c06918caaa28c44e2148574bc Signed-off-by: Taka Cho --- .../rest/serialization/TestXacmlJsonMessageBodyHandler.java | 10 +++++----- .../rest/serialization/TestXacmlXmlMessageBodyHandler.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'main/src/test/java/org/onap') 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 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 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 +} -- cgit 1.2.3-korg