diff options
author | 2020-06-15 12:16:09 +0530 | |
---|---|---|
committer | 2020-06-15 12:18:12 +0530 | |
commit | 748c56e1443ec45de92d4ff7bec5afc0768478d0 (patch) | |
tree | 91a5c2d93ca0a5ebc0ea4876e5bb63812ee67e12 /ecomp-sdk/epsdk-app-common/src/test/java | |
parent | 88a56a8071697d2a7dfa7db7e32c8a496218fb70 (diff) |
Fixed Logout, Empty White Page, Session Timeout
Logout, Empty White Page, Session Timeout Issues- fixed
Issue-ID: PORTAL-920
Change-Id: Ie96c5015397b88887e2fbc5422ce526eaacc8562
Signed-off-by: Sudarshan Kumar <sudarshan.kumar@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-common/src/test/java')
-rw-r--r-- | ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/LogoutControllerTest.java | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/LogoutControllerTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/LogoutControllerTest.java index 8883cfa8..71d7277a 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/LogoutControllerTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/controller/core/LogoutControllerTest.java @@ -37,9 +37,6 @@ */ package org.onap.portalapp.controller.core; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -111,46 +108,4 @@ public class LogoutControllerTest { .getProperty(PortalApiConstants.ECOMP_REDIRECT_URL)).thenReturn("http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm"); logoutController.globalLogout(mockedRequest); } - - @Test - public void globalLogoutExceptionTest(){ - PowerMockito.mockStatic(PortalApiProperties.class); - PowerMockito.mockStatic(PortalApiConstants.class); - Mockito.when(PortalApiProperties - .getProperty(PortalApiConstants.ECOMP_REDIRECT_URL)).thenReturn("http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm"); - assertNull(logoutController.globalLogout(mockedRequest)); - } - - @Test - public void appLogoutTest(){ - ModelAndView actualModelView = new ModelAndView("redirect:http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm"); - PowerMockito.mockStatic(PortalApiProperties.class); - PowerMockito.mockStatic(PortalApiConstants.class); - PowerMockito.mockStatic(RequestContextHolder.class); - ServletRequestAttributes ServletRequestAttributes = new ServletRequestAttributes(mockedRequest); - Mockito.when(RequestContextHolder.currentRequestAttributes()).thenReturn(ServletRequestAttributes); - Mockito.when(PortalApiProperties - .getProperty(PortalApiConstants.ECOMP_REDIRECT_URL)).thenReturn("http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm"); - ModelAndView expectedModelView = logoutController.appLogout(mockedRequest); - assertEquals(actualModelView.getViewName(), expectedModelView.getViewName()); - } - - @Test - public void appLogoutExceptionTest(){ - PowerMockito.mockStatic(PortalApiProperties.class); - PowerMockito.mockStatic(PortalApiConstants.class); - Mockito.when(PortalApiProperties - .getProperty(PortalApiConstants.ECOMP_REDIRECT_URL)).thenReturn("http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/login.htm"); - assertNull(logoutController.appLogout(mockedRequest)); - } - - @Test - public void getUserTest(){ - User expectedUser = new User(); - expectedUser.setActive(false); - user.setActive(false); - logoutController.setUser(user); - User actualUser = logoutController.getUser(); - assertEquals(expectedUser.getActive(), actualUser.getActive()); - } } |