diff options
author | Wojciech Sliwka <wojciech.sliwka@nokia.com> | 2018-08-20 15:45:03 +0200 |
---|---|---|
committer | Wojciech Sliwka <wojciech.sliwka@nokia.com> | 2018-08-24 12:26:03 +0200 |
commit | 17e8b54e83547d8dc37c335c5df1b989f8b5ff3c (patch) | |
tree | 87201581f26048e7c88a1d9339392f7c11d05b8e /vid-app-common/src/test/java/org/onap/vid/mso/rest | |
parent | 5adc0b0ee92d1e39ddaacd27e67a327dd5988f11 (diff) |
Replace sdc client
Replace old SDC client to use genericRestClient
Change-Id: I9b3b567871ac3f319742fca9457e42b6d4db0a8a
Issue-ID: VID-268
Signed-off-by: Wojciech Sliwka <wojciech.sliwka@nokia.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/mso/rest')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestIdTest.java | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestIdTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestIdTest.java index da2600ea..909975fb 100644 --- a/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestIdTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestIdTest.java @@ -2,9 +2,13 @@ package org.onap.vid.mso.rest; import com.google.common.collect.ImmutableList; import org.apache.commons.lang3.reflect.FieldUtils; -import org.mockito.*; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.InjectMocks; +import org.mockito.Matchers; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; import org.onap.vid.aai.util.AAIRestInterface; -import org.onap.vid.asdc.rest.RestfulAsdcClient; import org.onap.vid.changeManagement.RequestDetailsWrapper; import org.onap.vid.controller.filter.PromiseEcompRequestIdFilter; import org.onap.vid.mso.RestMsoImplementation; @@ -27,10 +31,13 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; -import static java.util.UUID.randomUUID; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.mockito.Mockito.mock; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.equalToIgnoringCase; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasToString; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.matchesPattern; public class OutgoingRequestIdTest { @@ -42,7 +49,6 @@ public class OutgoingRequestIdTest { @InjectMocks private AAIRestInterface aaiRestInterface; - private RestfulAsdcClient restfulAsdcClient = new RestfulAsdcClient.Builder(mock(Client.class), null).build(); @Captor private ArgumentCaptor<MultivaluedMap<String, Object>> multivaluedMapArgumentCaptor; @@ -58,23 +64,6 @@ public class OutgoingRequestIdTest { } @DataProvider - public Object[][] sdcMethods() { - return Stream.<ThrowingConsumer<RestfulAsdcClient>>of( - client -> client.getService(randomUUID()), - client -> client.getServiceToscaModel(randomUUID()) - ).map(l -> ImmutableList.of(l).toArray()).collect(Collectors.toList()).toArray(new Object[][]{}); - } - - @Test(dataProvider = "sdcMethods") - public void sdc(Consumer<RestfulAsdcClient> f) throws Exception { - final TestUtils.JavaxRsClientMocks mocks = setAndGetMocksInsideRestImpl(restfulAsdcClient); - - f.accept(restfulAsdcClient); - - verifyRequestIdHeaderWasAdded(mocks.getFakeBuilder()); - } - - @DataProvider public Object[][] msoMethods() { return Stream.<ThrowingConsumer<RestMsoImplementation>>of( |