Package com.github.tomakehurst.wiremock.testsupport

Examples of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient.addResponse()


    public void canRunOnAnotherPortThan8080() {
        WireMockServer wireMockServer = createServer(wireMockConfig().port(8090));
        wireMockServer.start();
        WireMockTestClient wireMockClient = new WireMockTestClient(8090);

        wireMockClient.addResponse(MappingJsonSamples.BASIC_MAPPING_REQUEST_WITH_RESPONSE_HEADER);
        WireMockResponse response = wireMockClient.get("/a/registered/resource");
        assertThat(response.statusCode(), is(401));
    }

View Full Code Here


        }
    }

    private void executeGetIn(String address) {
        WireMockTestClient wireMockClient = new WireMockTestClient(port, address);
        wireMockClient.addResponse(MappingJsonSamples.BASIC_MAPPING_REQUEST_WITH_RESPONSE_HEADER);
        WireMockResponse response = wireMockClient.get("/a/registered/resource");
        assertThat(response.statusCode(), is(401));
    }

    private String getIpAddressOtherThan(String lopbackAddress) throws SocketException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.