diff options
author | Kotta, Shireesha (sk434m) <sk434m@att.com> | 2018-03-06 09:44:53 -0500 |
---|---|---|
committer | Kotta, Shireesha (sk434m) <sk434m@att.com> | 2018-03-06 17:43:16 -0500 |
commit | cfb69f44f841338e1f208225ec006388e986bd2c (patch) | |
tree | e8b7e982637a5b27f3383a793fcdcee50f7e0057 /ecomp-sdk/epsdk-app-common/src/test | |
parent | 724ff8f8b22d6503ce5070ebc13f6f5fbc48c8cf (diff) |
Added Junits & AAF attributes Support
Issue-ID: PORTAL-136
Includes JUNITS, AAF attributes support
Change-Id: Id4cc9f64268017665d7245d0a10369c9b498ba2f
Signed-off-by: Kotta, Shireesha (sk434m) <sk434m@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-common/src/test')
-rw-r--r-- | ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java index 39b61b40..98ea0f8f 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java @@ -39,7 +39,6 @@ package org.onap.portalapp.service; import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -129,7 +128,7 @@ public class OnBoardingApiServiceImplTest { Assert.assertTrue(true); } - @Test(expected = PortalAPIException.class) + @Test(expected = org.onap.portalsdk.core.onboarding.exception.PortalAPIException.class) public void pushUserExceptionTest() throws Exception { PowerMockito.mockStatic(PortalApiProperties.class); Mockito.when(PortalApiProperties.getProperty(PortalApiConstants.ROLE_ACCESS_CENTRALIZED)).thenReturn("remote"); @@ -173,7 +172,7 @@ public class OnBoardingApiServiceImplTest { Mockito.when(PortalApiProperties.getProperty(PortalApiConstants.ROLE_ACCESS_CENTRALIZED)).thenReturn("remote"); String responseString = "Response"; - Mockito.when(restApiRequestBuilder.getViaREST("/user/" + loginId, true, loginId)).thenReturn(responseString); + Mockito.when(restApiRequestBuilder.getViaREST("/v1/user/" + loginId, true, loginId)).thenReturn(responseString); Mockito.when(userService.userMapper(responseString)).thenReturn(new User()); OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl(); @@ -201,7 +200,7 @@ public class OnBoardingApiServiceImplTest { PowerMockito.mockStatic(PortalApiProperties.class); Mockito.when(PortalApiProperties.getProperty(PortalApiConstants.ROLE_ACCESS_CENTRALIZED)).thenReturn("local"); String responseString = "Response"; - Mockito.when(restApiRequestBuilder.getViaREST("/user/" + loginId, true, loginId)).thenThrow(IOException.class); + Mockito.when(restApiRequestBuilder.getViaREST("/v1/user/" + loginId, true, loginId)).thenThrow(IOException.class); Mockito.when(userService.userMapper(responseString)).thenReturn(null); OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl(); @@ -320,7 +319,7 @@ public class OnBoardingApiServiceImplTest { public void getUserRolesTest() throws Exception { String loginId = "123"; String responseString = "Response"; - Mockito.when(restApiRequestBuilder.getViaREST("/user/" + loginId, true, loginId)).thenReturn(responseString); + Mockito.when(restApiRequestBuilder.getViaREST("/v1/user/" + loginId, true, loginId)).thenReturn(responseString); User user = new User(); SortedSet<Role> currentRoles = new TreeSet<>(); Role role = new Role(); @@ -333,10 +332,10 @@ public class OnBoardingApiServiceImplTest { Assert.assertNotNull(ecompRoles); } - @Test(expected = PortalAPIException.class) + @Test(expected = org.onap.portalsdk.core.onboarding.exception.PortalAPIException.class) public void getUserRolesExceptionTest() throws Exception { String loginId = "123"; - Mockito.when(restApiRequestBuilder.getViaREST("/user/" + loginId, true, loginId)).thenThrow(IOException.class); + Mockito.when(restApiRequestBuilder.getViaREST("/v1/user/" + loginId, true, loginId)).thenThrow(IOException.class); OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl(); onBoardingApiServiceImpl.getUserRoles(loginId); } |