summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi
diff options
context:
space:
mode:
authorKotta, Shireesha (sk434m) <sk434m@att.com>2019-06-28 15:27:29 -0400
committerKotta, Shireesha (sk434m) <sk434m@att.com>2019-06-28 15:27:29 -0400
commit179ff1eb0c1ac9eef4d152c47df5cb12a4584c0f (patch)
treeb9b744e106d688e807ffb31b6a986230034423d5 /ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi
parentd63c87226df57e7bd0513f9b17374716197056fa (diff)
PENTEST:Do not display stack trace for the api's
Issue-ID: PORTAL-654 PENTEST:Do not display stack trace for the api's and all users info for get_user api Change-Id: I68a4e3c7eba2628363275d63535290034591aa07 Signed-off-by: Kotta, Shireesha (sk434m) <sk434m@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi')
-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