diff options
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java index 7caafed00..ff71d85fc 100644 --- a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java @@ -20,6 +20,13 @@ */ package org.onap.vid.mso.rest; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyMap; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; +import static org.mockito.MockitoAnnotations.initMocks; + import io.joshworks.restclient.http.HttpResponse; import io.joshworks.restclient.http.JsonMapper; import org.apache.http.ProtocolVersion; @@ -42,14 +49,6 @@ import org.springframework.test.context.web.WebAppConfiguration; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import static org.mockito.ArgumentMatchers.any; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.anyMap; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.when; -import static org.mockito.MockitoAnnotations.initMocks; - @ContextConfiguration(classes = {LocalWebConfig.class, SystemProperties.class}) @WebAppConfiguration @@ -391,22 +390,6 @@ public class MsoRestClientTest { } @Test - public void shouldProperlyGetManualTasks() { - // given - String endpoint = "testEndpoint"; - HttpResponse<String> httpResponse = HttpResponse.fallback("testOkResponse"); - MsoResponseWrapper expectedResponse = MsoUtil.wrapResponse(httpResponse); - - when( client.get( eq(baseUrl+endpoint),anyMap(),anyMap(),eq(String.class) ) ).thenReturn(httpResponse); - - // when - MsoResponseWrapper response = restClient.getManualTasks(endpoint); - - // then - assertThat(response).isEqualToComparingFieldByField(expectedResponse); - } - - @Test public void shouldProperlyGetManualTasksByRequestId() { // given RestObject restObject = generateMockMsoRestObject(); @@ -415,8 +398,7 @@ public class MsoRestClientTest { HttpResponse<String> httpResponse = HttpResponse.fallback("testOkResponse"); MsoResponseWrapper expectedResponse = MsoUtil.wrapResponse(httpResponse); - /// WUT 'baseUrl+baseUrl+endpoint' - when( client.get( eq(baseUrl+baseUrl+endpoint),anyMap(),anyMap(),eq(String.class) ) ).thenReturn(httpResponse); + when( client.get( eq(baseUrl+endpoint),anyMap(),anyMap(),eq(String.class) ) ).thenReturn(httpResponse); // when MsoResponseWrapper response = restClient.getManualTasksByRequestId(null,null,endpoint,restObject); @@ -428,7 +410,7 @@ public class MsoRestClientTest { @Test(expectedExceptions = MsoTestException.class) public void shouldThrowExceptionWhenGetManualTasksByRequestIdGetsWrongParameter() { // given - when( client.get( eq(baseUrl+baseUrl),anyMap(),anyMap(),eq(String.class) ) ).thenThrow(new MsoTestException("testsException")); + when( client.get( eq(baseUrl),anyMap(),anyMap(),eq(String.class) ) ).thenThrow(new MsoTestException("testsException")); // when restClient.getManualTasksByRequestId(null,null,"",null); |