summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw/src/test/java/org/onap/portalsdk/core/onboarding/crossapi
diff options
context:
space:
mode:
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
ef='#n289'>289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375