summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-common/src/test
diff options
context:
space:
mode:
authorsa282w <sa282w@att.com>2018-05-02 17:00:20 -0400
committersa282w <sa282w@att.com>2018-05-03 16:51:59 -0400
commit22ed5d7b533cec97713c3b5aef37319d5dead6a3 (patch)
treedf40d050750cab3cf9b78e9820dd0bde8d16eaa9 /ecomp-sdk/epsdk-app-common/src/test
parentc607da68bfb7f7440d5be7f0396609dc01eb0e90 (diff)
API Versioning for ECOMP Components in SDK
Issue-ID: PORTAL-263 Included the api version changes for SDK. Change-Id: Ib81c5aabe585f6e2775e73a692153d1f286d1f45 Signed-off-by: sa282w <sa282w@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.java12
1 files changed, 6 insertions, 6 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 857a25eb..6ddcbcfb 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
@@ -172,7 +172,7 @@ public class OnBoardingApiServiceImplTest {
Mockito.when(PortalApiProperties.getProperty(PortalApiConstants.ROLE_ACCESS_CENTRALIZED)).thenReturn("remote");
String responseString = "Response";
- Mockito.when(restApiRequestBuilder.getViaREST("/v1/user/" + loginId, true, loginId)).thenReturn(responseString);
+ Mockito.when(restApiRequestBuilder.getViaREST("/v3/user/" + loginId, true, loginId)).thenReturn(responseString);
Mockito.when(userService.userMapper(responseString)).thenReturn(new User());
OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl();
@@ -200,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("/v1/user/" + loginId, true, loginId)).thenThrow(IOException.class);
+ Mockito.when(restApiRequestBuilder.getViaREST("/v3/user/" + loginId, true, loginId)).thenThrow(IOException.class);
Mockito.when(userService.userMapper(responseString)).thenReturn(null);
OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl();
@@ -215,7 +215,7 @@ public class OnBoardingApiServiceImplTest {
OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl();
String responseString = "[ {\"firstName\":\"Name\"}]";
- Mockito.when(restApiRequestBuilder.getViaREST("/users", true, null)).thenReturn(responseString);
+ Mockito.when(restApiRequestBuilder.getViaREST("/v3/users", true, null)).thenReturn(responseString);
List<EcompUser> users = onBoardingApiServiceImpl.getUsers();
Assert.assertNotNull(users);
}
@@ -227,7 +227,7 @@ public class OnBoardingApiServiceImplTest {
OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl();
String responseString = " { [ {\"firstName\":\"Name\"} ] }";
- Mockito.when(restApiRequestBuilder.getViaREST("/users", true, null)).thenReturn(responseString);
+ Mockito.when(restApiRequestBuilder.getViaREST("/v3/users", true, null)).thenReturn(responseString);
onBoardingApiServiceImpl.getUsers();
}
@@ -319,7 +319,7 @@ public class OnBoardingApiServiceImplTest {
public void getUserRolesTest() throws Exception {
String loginId = "123";
String responseString = "Response";
- Mockito.when(restApiRequestBuilder.getViaREST("/v1/user/" + loginId, true, loginId)).thenReturn(responseString);
+ Mockito.when(restApiRequestBuilder.getViaREST("/v3/user/" + loginId, true, loginId)).thenReturn(responseString);
User user = new User();
SortedSet<Role> currentRoles = new TreeSet<>();
Role role = new Role();
@@ -335,7 +335,7 @@ public class OnBoardingApiServiceImplTest {
@Test(expected = org.onap.portalsdk.core.onboarding.exception.PortalAPIException.class)
public void getUserRolesExceptionTest() throws Exception {
String loginId = "123";
- Mockito.when(restApiRequestBuilder.getViaREST("/v1/user/" + loginId, true, loginId)).thenThrow(IOException.class);
+ Mockito.when(restApiRequestBuilder.getViaREST("/v3/user/" + loginId, true, loginId)).thenThrow(IOException.class);
OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl();
onBoardingApiServiceImpl.getUserRoles(loginId);
}