diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2019-10-22 13:06:56 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2019-10-23 09:19:24 -0400 |
commit | 5bc83b197ad010bbdf5916493d078818c2c10bcb (patch) | |
tree | c4cc4bcf283047ebb71e2f338048a1f1760be11c /applications/guard/src/test/java | |
parent | fc07c32a4c01a2541c8061a37c3c6589c720e2b3 (diff) |
Consolidate common translatable code some sonar
There is duplicate code for some common translation of policy
decision responses and for scanning obligations.
Removed some TODO items (left others because I want to look
at them more closely).
Stored System.lineSeparator into a static var so that I can
remove some unnecessary ifs. There's still one left that I
am not worried about.
Gson as a static variable.
Issue-ID: POLICY-2066
Change-Id: I9c8162d5ad1c5f884be347dd94631fa74ca76f85
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/guard/src/test/java')
2 files changed, 4 insertions, 4 deletions
diff --git a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java index efa0bdc9..c75156df 100644 --- a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java +++ b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java @@ -106,7 +106,7 @@ public class CoordinationTest { // // Find the guard service application and save for use in all the tests // - StringBuilder strDump = new StringBuilder("Loaded applications:" + System.lineSeparator()); + StringBuilder strDump = new StringBuilder("Loaded applications:" + XacmlPolicyUtils.LINE_SEPARATOR); Iterator<XacmlApplicationServiceProvider> iterator = applicationLoader.iterator(); while (iterator.hasNext()) { XacmlApplicationServiceProvider application = iterator.next(); @@ -123,7 +123,7 @@ public class CoordinationTest { strDump.append(application.applicationName()); strDump.append(" supports "); strDump.append(application.supportedPolicyTypes()); - strDump.append(System.lineSeparator()); + strDump.append(XacmlPolicyUtils.LINE_SEPARATOR); } LOGGER.info("{}", strDump); // diff --git a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java index 7435fb96..9c3ae5b2 100644 --- a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java +++ b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java @@ -104,7 +104,7 @@ public class GuardPdpApplicationTest { // // Find the guard service application and save for use in all the tests // - StringBuilder strDump = new StringBuilder("Loaded applications:" + System.lineSeparator()); + StringBuilder strDump = new StringBuilder("Loaded applications:" + XacmlPolicyUtils.LINE_SEPARATOR); Iterator<XacmlApplicationServiceProvider> iterator = applicationLoader.iterator(); while (iterator.hasNext()) { XacmlApplicationServiceProvider application = iterator.next(); @@ -121,7 +121,7 @@ public class GuardPdpApplicationTest { strDump.append(application.applicationName()); strDump.append(" supports "); strDump.append(application.supportedPolicyTypes()); - strDump.append(System.lineSeparator()); + strDump.append(XacmlPolicyUtils.LINE_SEPARATOR); } LOGGER.info("{}", strDump); // |