diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2019-09-01 15:02:06 +0300 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2019-09-01 15:02:06 +0300 |
commit | e6c30425575cd76a3955b03ab389150ed74fbb1d (patch) | |
tree | e1a668efc3bbd6b5da72ebd8b9825d5e1a96d74c /vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java | |
parent | 406cc2fe614d089c2f7834f9a22d6dfa47b4fa16 (diff) |
handle non OK response from SDC while getting model
Issue-ID: VID-378
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Change-Id: Idc6e587abb24fbec65ed159db7008e50abee2581
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java index ffabc18a2..c0683425b 100644 --- a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java @@ -55,7 +55,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.joshworks.restclient.http.HttpResponse; import java.io.IOException; import java.net.URL; -import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -97,6 +96,7 @@ import org.onap.vid.mso.rest.Request; import org.onap.vid.mso.rest.RequestDetails; import org.onap.vid.mso.rest.RequestDetailsWrapper; import org.onap.vid.mso.rest.Task; +import org.onap.vid.testUtils.TestUtils; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.test.context.ContextConfiguration; @@ -1442,11 +1442,7 @@ public class MsoBusinessLogicImplTest extends AbstractTestNGSpringContextTests { HttpResponse<String> httpResponse = mockForGetOrchestrationRequest(); when(httpResponse.getStatus()).thenReturn(statusCode); when(httpResponse.getBody()).thenReturn(body); - try { - when(httpResponse.getRawBody()).thenReturn(IOUtils.toInputStream(body, StandardCharsets.UTF_8.name())); - } catch (IOException e) { - throw new RuntimeException(e); - } + TestUtils.mockGetRawBodyWithStringBody(httpResponse, body); return httpResponse; } |