aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/guard/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-08-13 15:52:22 -0400
committerJim Hahn <jrh3@att.com>2019-08-15 09:21:28 -0400
commitfdaae76549bafb2e482c02fb26de719c69431b48 (patch)
treea3f477da55f80fe7e4bed3d959d8089cf1971438 /controlloop/common/guard/src/test
parent9e8023a455633c7daf0dd291c6268986e39352d7 (diff)
Modify to work with new drools-pdp
Due to sonar fixes, drools-pdp changed in a way that requires changes to drools-applications. In the case of template.demo, lots of test cases had to be modified, so they were refactored to extract common setup and tear down code. Fixed checkstyle issues. Fixed license date. Change-Id: Ie9e0239b95916ae7ef8c1b669987f7bb07d841b9 Issue-ID: POLICY-1968 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/guard/src/test')
-rw-r--r--controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardXacmlHelperTest.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardXacmlHelperTest.java b/controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardXacmlHelperTest.java
index 9d252b9f1..d0194da38 100644
--- a/controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardXacmlHelperTest.java
+++ b/controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardXacmlHelperTest.java
@@ -28,7 +28,7 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
-import org.onap.policy.drools.system.PolicyEngine;
+import org.onap.policy.drools.system.PolicyEngineConstants;
import org.onap.policy.drools.utils.logging.LoggerUtil;
public class PolicyGuardXacmlHelperTest {
@@ -106,45 +106,45 @@ public class PolicyGuardXacmlHelperTest {
@Test
public void testInit() {
- final Properties savedEnvironment = (Properties) PolicyEngine.manager.getEnvironment().clone();
+ final Properties savedEnvironment = (Properties) PolicyEngineConstants.getManager().getEnvironment().clone();
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().setProperty(GUARD_URL,
+ PolicyEngineConstants.getManager().getEnvironment().setProperty(GUARD_URL,
"http://localhost:6669/pdp/api/getDecision,Dorothy");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().setProperty(GUARD_URL,
+ PolicyEngineConstants.getManager().getEnvironment().setProperty(GUARD_URL,
"http://localhost:6669/pdp/api/getDecision,Dorothy,Toto");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().setProperty(GUARD_URL,
+ PolicyEngineConstants.getManager().getEnvironment().setProperty(GUARD_URL,
"http://localhost:6969/policy/pdpx/v1/decision");
- PolicyEngine.manager.getEnvironment().setProperty("pdpx.timeout", "thisIsNotANumber");
+ PolicyEngineConstants.getManager().getEnvironment().setProperty("pdpx.timeout", "thisIsNotANumber");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().setProperty("pdpx.timeout", "1000");
+ PolicyEngineConstants.getManager().getEnvironment().setProperty("pdpx.timeout", "1000");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().remove("pdpx.password");
+ PolicyEngineConstants.getManager().getEnvironment().remove("pdpx.password");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().setProperty("pdpx.username", "python");
+ PolicyEngineConstants.getManager().getEnvironment().setProperty("pdpx.username", "python");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().setProperty(GUARD_URL, "///");
+ PolicyEngineConstants.getManager().getEnvironment().setProperty(GUARD_URL, "///");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().setProperty("guard.disabled", "");
+ PolicyEngineConstants.getManager().getEnvironment().setProperty("guard.disabled", "");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().setProperty("guard.disabled", "true");
+ PolicyEngineConstants.getManager().getEnvironment().setProperty("guard.disabled", "true");
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.getEnvironment().clear();
+ PolicyEngineConstants.getManager().getEnvironment().clear();
assertNotNull(new PolicyGuardXacmlHelper());
- PolicyEngine.manager.setEnvironment(savedEnvironment);
+ PolicyEngineConstants.getManager().setEnvironment(savedEnvironment);
}
}