Examples of wasConfigured()


Examples of com.github.tomakehurst.wiremock.http.Response.wasConfigured()

   
    Request request = new Jetty6HttpServletRequestAdapter(httpServletRequest, mappedUnder);
        notifier.info("Received request: " + httpServletRequest.toString());

    Response response = requestHandler.handle(request);
    if (response.wasConfigured()) {
        applyResponse(response, httpServletResponse);
    } else if (request.getMethod() == GET && shouldForwardToFilesContext) {
        forwardToFilesContext(httpServletRequest, httpServletResponse, request);
    } else {
      httpServletResponse.sendError(HTTP_NOT_FOUND);
View Full Code Here

Examples of com.github.tomakehurst.wiremock.http.ResponseDefinition.wasConfigured()

  @Test
  public void returnsNotConfiguredResponseForUnmappedRequest() {
    Request request = aRequest(context).withMethod(OPTIONS).withUrl("/not/mapped").build();
    ResponseDefinition response = mappings.serveFor(request);
    assertThat(response.getStatus(), is(HTTP_NOT_FOUND));
    assertThat(response.wasConfigured(), is(false));
  }
 
  @Test
  public void returnsMostRecentlyInsertedResponseIfTwoOrMoreMatch() {
    mappings.addMapping(new StubMapping(
View Full Code Here

Examples of com.github.tomakehurst.wiremock.http.ResponseDefinition.wasConfigured()

    ResponseDefinition response =
      mappings.serveFor(
          aRequest(context, "1st get /scenario/resource")
          .withMethod(GET).withUrl("/scenario/resource").build());
   
    assertThat(response.wasConfigured(), is(false));
   
    mappings.resetScenarios();
    response =
      mappings.serveFor(
          aRequest(context, "2nd get /scenario/resource")
View Full Code Here

Examples of com.github.tomakehurst.wiremock.http.ResponseDefinition.wasConfigured()

   
    @Test
    public void copyPreservesConfiguredFlag() {
        ResponseDefinition response = ResponseDefinition.notConfigured();
        ResponseDefinition copiedResponse = copyOf(response);
        assertFalse("Should be not configured", copiedResponse.wasConfigured());
    }

    private static final String STRING_BODY =
            "{                          \n" +
            "    \"status\": 200,            \n" +
View Full Code Here

Examples of com.github.tomakehurst.wiremock.http.ResponseDefinition.wasConfigured()

   
    @Override
    public ResponseDefinition serveStubFor(Request request) {
        ResponseDefinition responseDefinition = stubMappings.serveFor(request);
        requestJournal.requestReceived(request);
        if (!responseDefinition.wasConfigured() && request.isBrowserProxyRequest() && browserProxyingEnabled) {
            return ResponseDefinition.browserProxy(request);
        }

        return responseDefinition;
    }
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.