diff options
author | Wojciech Sliwka <wojciech.sliwka@nokia.com> | 2019-06-19 11:06:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-06-19 11:06:54 +0000 |
commit | 7f0e6936709cc19e3e1e1ad035e5b7d00809d6c6 (patch) | |
tree | 163542e67746e7693daf12e7835f5b2f6c78255a /vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientTest.java | |
parent | 46adb535d3af416773475b9aabb2ace8e1e9e1de (diff) | |
parent | 72b3fb69e548cf665204ec025d2778dcf3ce0216 (diff) |
Merge "Extend probe mechanism"
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientTest.java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientTest.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientTest.java index 5202661da..a20571785 100644 --- a/vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientTest.java @@ -27,17 +27,23 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.onap.vid.asdc.AsdcCatalogException; +import org.onap.vid.asdc.AsdcClient; import org.onap.vid.asdc.beans.Service; import org.onap.vid.client.SyncRestClient; import java.io.InputStream; import java.nio.file.Path; +import java.util.Collections; import java.util.UUID; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.mockito.ArgumentMatchers.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyMap; +import static org.mockito.ArgumentMatchers.contains; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.matches; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) @@ -60,6 +66,9 @@ public class SdcRestClientTest { private HttpResponse<InputStream> httpStreamResponse; @Mock + private HttpResponse<String> httpStringResponse; + + @Mock private InputStream inputStream; private UUID randomId; @@ -123,6 +132,16 @@ public class SdcRestClientTest { restClient.getServiceToscaModel(randomId); } + @Test + public void shouldCallSDCHealthCheck() { + when(mockedSyncRestClient.get(contains(AsdcClient.URIS.HEALTH_CHECK_ENDPOINT), anyMap(), + eq(Collections.emptyMap()), eq(String.class))).thenReturn(httpStringResponse); + + + HttpResponse<String> stringHttpResponse = restClient.checkSDCConnectivity(); + + assertThat(httpStringResponse, is(stringHttpResponse)); + } private Service createTestService() { Service service = new Service(); |