From 5e036e48759741ad72dd4878314ad9c016ac9ba6 Mon Sep 17 00:00:00 2001 From: Dominik Mizyn Date: Tue, 16 Jul 2019 13:00:07 +0200 Subject: EPUserUtils class fix Sonar errors EPUserUtils class fix Issue-ID: PORTAL-667 Change-Id: I7a8a39ac52ee2da5d2c2ab0016a8bbea0acb4d21 Signed-off-by: Dominik Mizyn --- .../test/java/org/onap/portalapp/util/EPUserUtilsTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ecomp-portal-BE-common/src/test/java/org/onap') diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/util/EPUserUtilsTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/util/EPUserUtilsTest.java index 7383330d..80ca1424 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/util/EPUserUtilsTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/util/EPUserUtilsTest.java @@ -256,7 +256,7 @@ public class EPUserUtilsTest { PowerMockito.when(AppUtils.getSession(mockedRequest)).thenReturn(session); PowerMockito.when(SystemProperties.getProperty(Matchers.anyString())).thenReturn("12"); Mockito.when(session.getAttribute(Matchers.anyString())).thenReturn(roles); - roles=EPUserUtils.getRoles(mockedRequest); + roles= (HashMap) EPUserUtils.getRoles(mockedRequest); assertEquals(roles,expected); @@ -279,7 +279,7 @@ public class EPUserUtilsTest { Mockito.when(session.getAttribute("attr_name")).thenReturn(user); Mockito.when(user.getEPRoles()).thenReturn(role); Mockito.when(session.getAttribute("12")).thenReturn(null); - roles=EPUserUtils.getRoles(mockedRequest); + roles= (HashMap) EPUserUtils.getRoles(mockedRequest); assertEquals(roles,expected); } @@ -320,7 +320,7 @@ public class EPUserUtilsTest { Mockito.when(epRole.getChildRoles()).thenReturn(childRoles); Mockito.when(user.getEPUserApps()).thenReturn(epUserApps); Mockito.when(session.getAttribute("12")).thenReturn(null); - roles= EPUserUtils.getRoles(mockedRequest); + roles= (HashMap) EPUserUtils.getRoles(mockedRequest); assertNotNull(roles); } @@ -358,7 +358,7 @@ public class EPUserUtilsTest { Mockito.when(epRoleFunctionService.getRoleFunctions()).thenReturn(roleFunctions); Mockito.when(MenuBuilder.filterMenu(applicationMenuData, mockedRequest)).thenReturn(applicationMenuData); PowerMockito.when(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME)).thenReturn("12"); - EPUserUtils.setUserSession(mockedRequest, user, applicationMenuData, businessDirectMenuData, "login_method", epRoleFunctionService); + EPUserUtils.setUserSession(mockedRequest, user, applicationMenuData, businessDirectMenuData, epRoleFunctionService); assertNotNull(session); @@ -383,7 +383,7 @@ public class EPUserUtilsTest { Mockito.when(epRoleFunctionService.getRoleFunctions()).thenReturn(null); Mockito.when(MenuBuilder.filterMenu(applicationMenuData, mockedRequest)).thenReturn(applicationMenuData); PowerMockito.when(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME)).thenReturn("12"); - EPUserUtils.setUserSession(mockedRequest, user, applicationMenuData, businessDirectMenuData, "login_method", epRoleFunctionService); + EPUserUtils.setUserSession(mockedRequest, user, applicationMenuData, businessDirectMenuData, epRoleFunctionService); assertNotNull(session); } @@ -408,7 +408,7 @@ public class EPUserUtilsTest { Mockito.when(epRoleFunctionService.getRoleFunctions()).thenReturn(null); Mockito.when(MenuBuilder.filterMenu(applicationMenuData, mockedRequest)).thenReturn(applicationMenuData); PowerMockito.when(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME)).thenReturn("12"); - EPUserUtils.setUserSession(mockedRequest, user, applicationMenuData, businessDirectMenuData, "login_method", epRoleFunctionService); + EPUserUtils.setUserSession(mockedRequest, user, applicationMenuData, businessDirectMenuData, epRoleFunctionService); assertNotNull(session); -- cgit 1.2.3-korg