summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/util
diff options
context:
space:
mode:
authorLott, Christopher (cl778h) <cl778h@att.com>2019-07-29 11:41:36 -0400
committerLott, Christopher (cl778h) <cl778h@att.com>2019-07-30 13:35:33 -0400
commit19087734d0cd4d7e7c892490a795b01e93ba00d0 (patch)
treedc18fcd42374b9c74098b09f20ca99245b13bad5 /ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/util
parent69d4e12be832b560ed5ee1bb84a4ab3b0855310f (diff)
Publish fixed strings as public constants
Change-Id: I47c8458a0f16251ef19043eb63cf5f392990efdf Issue-ID: PORTAL-657 Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/util')
-rw-r--r--ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/util/AuthUtilTest.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/util/AuthUtilTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/util/AuthUtilTest.java
index 00745922..ec3135f1 100644
--- a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/util/AuthUtilTest.java
+++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/util/AuthUtilTest.java
@@ -48,6 +48,7 @@ import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mockito;
import org.onap.aaf.cadi.CadiWrap;
+import org.onap.portalsdk.core.onboarding.crossapi.IPortalRestCentralService;
import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
public class AuthUtilTest {
@@ -77,29 +78,29 @@ public class AuthUtilTest {
@Test(expected = PortalAPIException.class)
public void isAccessAllowedExceptionTest() throws PortalAPIException {
Map<String, String> appCreds = new HashMap<>();
- appCreds.put("username", "test");
- appCreds.put("password", "test1");
+ appCreds.put(IPortalRestCentralService.CREDENTIALS_USER, "test");
+ appCreds.put(IPortalRestCentralService.CREDENTIALS_PASS, "test1");
AuthUtil.isAccessAllowed(request, "com.test", appCreds);
}
@Test
public void isAccessAllowedTest() throws PortalAPIException {
- Mockito.when(request.getHeader("username")).thenReturn("test");
- Mockito.when(request.getHeader("password")).thenReturn("test1");
+ Mockito.when(request.getHeader(IPortalRestCentralService.CREDENTIALS_USER)).thenReturn("test");
+ Mockito.when(request.getHeader(IPortalRestCentralService.CREDENTIALS_PASS)).thenReturn("test1");
Map<String, String> appCreds = new HashMap<>();
- appCreds.put("username", "test");
- appCreds.put("password", "test1");
+ appCreds.put(IPortalRestCentralService.CREDENTIALS_USER, "test");
+ appCreds.put(IPortalRestCentralService.CREDENTIALS_PASS, "test1");
assertTrue(AuthUtil.isAccessAllowed(request, "com.test", appCreds));
}
@Test
public void isAccessAllowedFalseTest() throws PortalAPIException {
- Mockito.when(request.getHeader("username")).thenReturn("test");
- Mockito.when(request.getHeader("password")).thenReturn("test1");
+ Mockito.when(request.getHeader(IPortalRestCentralService.CREDENTIALS_USER)).thenReturn("test");
+ Mockito.when(request.getHeader(IPortalRestCentralService.CREDENTIALS_PASS)).thenReturn("test1");
Map<String, String> appCreds = new HashMap<>();
- appCreds.put("username", "test");
- appCreds.put("password", "test123");
- appCreds.put("appName", "testApp");
+ appCreds.put(IPortalRestCentralService.CREDENTIALS_USER, "test");
+ appCreds.put(IPortalRestCentralService.CREDENTIALS_PASS, "test123");
+ appCreds.put(IPortalRestCentralService.CREDENTIALS_APP, "testApp");
assertFalse(AuthUtil.isAccessAllowed(request, "com.test", appCreds));
}