Package com.github.tomakehurst.wiremock.testsupport

Examples of com.github.tomakehurst.wiremock.testsupport.WireMockResponse.content()


        assertThat(response1.content(), is(""));

        testClient.resetDefaultMappings();

        WireMockResponse response2 = testClient.get("/testmapping");
        assertThat(response2.content(), is("default test mapping"));
    }

    @Test
    public void readsMapppingForByteBody() {
        testClient.addResponse(MAPPING_REQUEST_FOR_BYTE_BODY);
View Full Code Here


        .withBody("Not allowed!")));
   
    WireMockResponse response = testClient.get("/a/registered/resource");
   
    assertThat(response.statusCode(), is(401));
    assertThat(response.content(), is("Not allowed!"));
    assertThat(response.firstHeader("Content-Type"), is("text/plain"));
  }
 
  @Test
  public void mappingWithUrlContainingQueryParameters() {
View Full Code Here

        .withStatus(200)
        .withBodyFile("plain-example.txt")));
   
    WireMockResponse response = testClient.get("/my/file");
   
    assertThat(response.content(), is("Some example test from a file"));
  }
 
  @Test
  public void matchingOnRequestBodyWithTwoRegexes() {
    stubFor(put(urlEqualTo("/match/this/body"))
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.