import static com.github.tomakehurst.wiremock.client.WireMock.matching;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.apihandlerinfra.BaseTest;
import org.onap.so.apihandlerinfra.TestAppender;
-import org.onap.so.client.grm.GRMClient;
import org.onap.so.client.grm.beans.ServiceEndPoint;
import org.onap.so.client.grm.beans.ServiceEndPointList;
import org.onap.so.client.grm.beans.ServiceEndPointLookupRequest;
public void testFind() throws Exception {
TestAppender.events.clear();
String endpoints = getFileContentsAsString("__files/grm/endpoints.json");
- stubFor(post(urlPathEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
+ wireMockServer.stubFor(post(urlPathEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", MediaType.APPLICATION_JSON)
if(!foundInvokeReturn)
fail("INVOKE RETURN Marker not found");
- verify(postRequestedFor(urlEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
+ wireMockServer.verify(postRequestedFor(urlEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
.withHeader(ONAPLogConstants.Headers.INVOCATION_ID.toString(), matching(uuidRegex))
.withHeader(ONAPLogConstants.Headers.REQUEST_ID.toString(), matching(uuidRegex))
.withHeader(ONAPLogConstants.Headers.PARTNER_NAME.toString(), equalTo("SO")));
@Test
public void testFindFail() throws Exception {
- stubFor(post(urlPathEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
+ wireMockServer.stubFor(post(urlPathEqualTo("/GRMLWPService/v1/serviceEndPoint/findRunning"))
.willReturn(aResponse()
.withStatus(400)
.withHeader("Content-Type", MediaType.APPLICATION_JSON)
@Test
public void testAddFail() throws Exception {
- stubFor(post(urlPathEqualTo("/GRMLWPService/v1/serviceEndPoint/add"))
+ wireMockServer.stubFor(post(urlPathEqualTo("/GRMLWPService/v1/serviceEndPoint/add"))
.willReturn(aResponse()
.withStatus(404)
.withHeader("Content-Type", MediaType.APPLICATION_JSON)