summaryrefslogtreecommitdiffstats
path: root/ONAP-PDP-REST
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-10-29 17:46:54 +0000
committerliamfallon <liam.fallon@est.tech>2019-10-30 07:45:39 +0000
commit8cd932fa5448cc300637b583361669cb73563db6 (patch)
tree70b02dd3f9b70d0e345ce41cd7989ecfc0e31da5 /ONAP-PDP-REST
parentc46961c5322b8113dcf859e07e596bd7e473bc5d (diff)
Fix unit test failure in ONAP-PDP-REST
Unit test parameters were cleared by earlier tests, test setup changed to initiate paramters required by the test. Issue-ID: POLICY-2205 Change-Id: Ia460226ae5fb6e0c42ba9840bd4fe3952dbd1a13 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'ONAP-PDP-REST')
-rw-r--r--ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/auth/test/AuthenticationServiceTest.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/auth/test/AuthenticationServiceTest.java b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/auth/test/AuthenticationServiceTest.java
index 0795526fc..4f03221b7 100644
--- a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/auth/test/AuthenticationServiceTest.java
+++ b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/auth/test/AuthenticationServiceTest.java
@@ -24,11 +24,15 @@ package org.onap.policy.pdp.rest.auth.test;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
+
+import com.att.research.xacml.util.XACMLProperties;
+
import java.io.UnsupportedEncodingException;
import java.util.Base64;
import javax.servlet.ServletRequest;
import org.junit.Test;
import org.onap.policy.pdp.rest.restauth.AuthenticationService;
+import org.onap.policy.rest.XacmlRestProperties;
public class AuthenticationServiceTest {
private final String testCred = "python:test";
@@ -40,10 +44,13 @@ public class AuthenticationServiceTest {
String systemKey = "xacml.properties";
// Set the system property temporarily
- String oldProperty = System.getProperty(systemKey);
+ final String oldProperty = System.getProperty(systemKey);
System.setProperty(systemKey, "xacml.pdp.properties");
- ServletRequest request = mock(ServletRequest.class);
+ XACMLProperties.setProperty("enable_aaf", "false");
+ XACMLProperties.setProperty(XacmlRestProperties.PROP_PEP_IDFILE, "client.properties");
+ ServletRequest request = mock(ServletRequest.class);
+ AuthenticationService.getEnvironment();
assertTrue(AuthenticationService.checkPermissions(null, basicCred, "getConfig", "DEVL", request));
// Restore the original system property