aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
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
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')
-rw-r--r--main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java4
-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
3 files changed, 12 insertions, 12 deletions
diff --git a/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java b/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java
index a2f139d6..4882760e 100644
--- a/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java
+++ b/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -92,7 +92,7 @@ public class XacmlPdpUpdatePublisher {
}
}
// Return current deployed policies
- message.setPolicies(new ArrayList<ToscaPolicy>(appManager.getToscaPolicies().keySet()));
+ message.setPolicies(new ArrayList<>(appManager.getToscaPolicies().keySet()));
LOGGER.debug("Returning current deployed policies: {} ", message.getPolicies());
// update the policy count statistic
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
+}