summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-fw/src/test/java')
-rw-r--r--ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxyTest.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxyTest.java b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxyTest.java
index ce1035e7..897f84a1 100644
--- a/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxyTest.java
+++ b/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi/PortalRestAPIProxyTest.java
@@ -44,6 +44,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.HashMap;
+import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
@@ -119,7 +120,8 @@ public class PortalRestAPIProxyTest {
doPost.setAccessible(true);
doGet = portalRestAPIProxyClass.getDeclaredMethod("doGet", new Class[]{HttpServletRequest.class, HttpServletResponse.class});
doGet.setAccessible(true);
- Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request)).thenReturn(true);
+ Map<String,String> appCredentials = new HashMap<>();
+ Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request,appCredentials)).thenReturn(true);
}
@Test(expected=ServletException.class)
@@ -203,14 +205,16 @@ public class PortalRestAPIProxyTest {
@Test
public void testDoPost_WhenIsAppAuthenticatedIsFalse() throws Exception {
- Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request)).thenReturn(false);
+ Map<String,String> appCredentials = new HashMap<>();
+ Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request,appCredentials)).thenReturn(false);
Mockito.when(request.getRequestURI()).thenReturn("");
doPost.invoke(portalRestAPIProxyObj, new Object[] {request, response});
}
@Test
public void testDoPost_WhenIsAppAuthenticatedThrowException() throws Exception {
- Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request)).thenThrow(new PortalAPIException());
+ Map<String,String> appCredentials = new HashMap<>();
+ Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request,appCredentials)).thenThrow(new PortalAPIException());
Mockito.when(request.getRequestURI()).thenReturn("");
doPost.invoke(portalRestAPIProxyObj, new Object[] {request, response});
}
@@ -285,15 +289,17 @@ public class PortalRestAPIProxyTest {
@Test
public void testDoGet_WhenIsAppAuthenticatedIsFalse() throws Exception {
- Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request)).thenReturn(false);
+ Map<String,String> appCredentials = new HashMap<>();
+ Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request,appCredentials)).thenReturn(false);
Mockito.when(request.getRequestURI()).thenReturn("");
doGet.invoke(portalRestAPIProxyObj, new Object[] {request, response});
}
@Test
public void testDoGet_WhenIsAppAuthenticatedThrowException() throws Exception {
- Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request)).thenThrow(new PortalAPIException());
+ Map<String,String> appCredentials = new HashMap<>();
+ Mockito.when(portalRestAPICentralServiceImpl.isAppAuthenticated(request,appCredentials)).thenThrow(new PortalAPIException());
Mockito.when(request.getRequestURI()).thenReturn("");
doGet.invoke(portalRestAPIProxyObj, new Object[] {request, response});
}
-}
+} \ No newline at end of file