X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-PDP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpdp%2Frest%2Fauth%2Ftest%2FAuthenticationServiceTest.java;h=4f03221b71dcb943c663bd42b61780472b816cf1;hp=0795526fc6977e1f12af3f3ee8c8a4b4227f07e9;hb=8cd932fa5448cc300637b583361669cb73563db6;hpb=c46961c5322b8113dcf859e07e596bd7e473bc5d 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