summaryrefslogtreecommitdiffstats
path: root/applications/common/src/test/java
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-03-19 16:08:58 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-03-20 09:42:11 -0400
commit6e55b1d7c3e53fb49c5e94406ff5db4cb9990c87 (patch)
tree6f88e9e6e15b1a695426ec07b0d3dbb0a4cf0ce2 /applications/common/src/test/java
parent041240baab6082916e5da69ed190051b7aa60f12 (diff)
Use Policy Translator abstract class
Instead of applications implementing the converter, use a protected abstract class that implements common code. Newer applications could re-use existing application, and shared code can be put into the base translator class. Fixed sonar issue and changed guard xml. Removed Converter and made translator into an implementation class that is an object in the Application Provider. Issue-ID: POLICY-1273 Change-Id: I9b48cbcdaf80d6d2ef19ef53e4b7cd4830e7e7b2 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/common/src/test/java')
-rw-r--r--applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/ToscaPolicyTranslatorUtilsTest.java (renamed from applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/ToscaPolicyConverterUtilsTest.java)6
-rw-r--r--applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/ToscaPolicyConverterUtilsTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/ToscaPolicyTranslatorUtilsTest.java
index cc1787c3..6fdb8772 100644
--- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/ToscaPolicyConverterUtilsTest.java
+++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/ToscaPolicyTranslatorUtilsTest.java
@@ -29,12 +29,12 @@ import java.lang.reflect.Modifier;
import org.junit.Test;
-public class ToscaPolicyConverterUtilsTest {
+public class ToscaPolicyTranslatorUtilsTest {
@Test
public void test() throws NoSuchMethodException, SecurityException {
- final Constructor<ToscaPolicyConverterUtils> constructor
- = ToscaPolicyConverterUtils.class.getDeclaredConstructor();
+ final Constructor<ToscaPolicyTranslatorUtils> constructor
+ = ToscaPolicyTranslatorUtils.class.getDeclaredConstructor();
assertTrue(Modifier.isPrivate(constructor.getModifiers()));
}
diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
index 57800d9e..fe0f675d 100644
--- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
+++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
@@ -162,7 +162,7 @@ public class XacmlPolicyUtilsTest {
//
// Create The Match
//
- MatchType matchPolicyId = ToscaPolicyConverterUtils.buildMatchTypeDesignator(
+ MatchType matchPolicyId = ToscaPolicyTranslatorUtils.buildMatchTypeDesignator(
XACML3.ID_FUNCTION_STRING_EQUAL,
resource,
XACML3.ID_DATATYPE_STRING,
@@ -175,7 +175,7 @@ public class XacmlPolicyUtilsTest {
//
// Create AllOf (AND) of just Policy Id
//
- anyOf.getAllOf().add(ToscaPolicyConverterUtils.buildAllOf(matchPolicyId));
+ anyOf.getAllOf().add(ToscaPolicyTranslatorUtils.buildAllOf(matchPolicyId));
TargetType target = new TargetType();
target.getAnyOf().add(anyOf);
policy.setTarget(target);