import static com.xebialabs.restito.semantics.Action.stringContent;
import static org.apache.http.client.config.RequestConfig.custom;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+import static org.hamcrest.collection.IsMapContaining.hasKey;
import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
import static org.onap.vid.client.SyncRestClientInterface.HEADERS.X_ECOMP_INSTANCE_ID;
-import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.xebialabs.restito.semantics.Call;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.onap.vid.asdc.beans.Service;
import org.onap.vid.client.SyncRestClient;
import org.onap.vid.testUtils.StubServerUtil;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.xebialabs.restito.semantics.Call;
+import org.onap.vid.utils.Logging;
public class SdcRestClientITTest {
public static void setUpClass() throws GeneralSecurityException {
stubServer = new StubServerUtil();
stubServer.runSecuredServer();
- SyncRestClient syncRestClient = new SyncRestClient(createNaiveHttpClient());
+ SyncRestClient syncRestClient = new SyncRestClient(createNaiveHttpClient(), mock(Logging.class));
String serverUrl = stubServer.constructTargetUrl("https", "");
- sdcRestClient = new SdcRestClient(serverUrl, "", syncRestClient);
+ sdcRestClient = new SdcRestClient(serverUrl, "", syncRestClient, mock(Logging.class));
}
@AfterClass
assertTrue(first.isPresent());
- assertThat(first.get().getHeaders().keySet(),
- hasItems(X_ECOMP_INSTANCE_ID.toLowerCase(), REQUEST_ID_HEADER_KEY.toLowerCase()));
- assertThat(first.get().getHeaders().get(REQUEST_ID_HEADER_KEY.toLowerCase()).get(0),
- matchesPattern(UUID_REGEX));
+ assertThat(first.get().getHeaders(), hasKey(equalToIgnoringCase(X_ECOMP_INSTANCE_ID)));
}
private Service getExpectedService(String stringId) {