private void setQueryString(HttpRequest httpRequest, HttpServletRequest httpServletRequest) { Parameters parameters = new Parameters(); if (StringUtils.isNotEmpty(httpServletRequest.getQueryString())) { parameters.withEntries(new QueryStringDecoder("?" + httpServletRequest.getQueryString()).parameters()); } httpRequest.withQueryStringParameters(parameters); }
private void setQueryString(HttpRequest httpRequest, QueryStringDecoder queryStringDecoder) { Parameters parameters = new Parameters(); try { parameters.withEntries(queryStringDecoder.parameters()); } catch (IllegalArgumentException iae) { mockServerLogger.error(httpRequest, "Exception while parsing query string", iae); } httpRequest.withQueryStringParameters(parameters); }
public HttpRequest buildObject() { return new HttpRequest() .withMethod(method) .withPath(path) .withQueryStringParameters(queryStringParameters) .withBody((body != null ? Not.not(body.buildObject(), body.getNot()) : null)) .withHeaders(headers) .withCookies(cookies) .withSecure(secure) .withKeepAlive(keepAlive); }
public HttpRequest clone() { return not(request(), not) .withMethod(method) .withPath(path) .withQueryStringParameters(getQueryStringParameters().clone()) .withBody(body) .withHeaders(getHeaders().clone()) .withCookies(getCookies().clone()) .withKeepAlive(keepAlive) .withSecure(secure); }
.withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param(string("queryStringParameterOneName"), not("Parameter One Value One"), not("Parameter One Value Two")), param("queryStringParameterTwoName", "Parameter Two") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "OTHER Parameter One Value One", "OTHER Parameter One Value Two"), param("queryStringParameterTwoName", "Parameter Two")
.withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param(not("queryStringParameterOneName"), not("Parameter One Value One"), not("Parameter One Value Two")), param("queryStringParameterTwoName", "Parameter Two") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "Parameter One Value One", "Parameter One Value Two"), param("queryStringParameterTwoName", "Parameter Two") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "Parameter One Value One", "Parameter One Value Two"), param("queryStringParameterTwoName", "Parameter Two")
.withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param(not("queryStringParameterOneName"), string("Parameter One Value One"), string("Parameter One Value Two")), param("queryStringParameterTwoName", "Parameter Two") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("OTHERQueryStringParameterOneName", "Parameter One Value One", "Parameter One Value Two"), param("queryStringParameterTwoName", "Parameter Two")
.withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param(not("queryStringParameterOneName"), not("Parameter One Value One"), not("Parameter One Value Two")), param("queryStringParameterTwoName", "Parameter Two") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("OTHERQueryStringParameterOneName", "Parameter One Value One", "Parameter One Value Two"), param("queryStringParameterTwoName", "Parameter Two") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "OTHER Parameter One Value One", "OTHER Parameter One Value Two"), param("queryStringParameterTwoName", "Parameter Two")
.withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValueOne", "queryStringParameterOneValueTwo"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "OTHERqueryStringParameterOneValueOne", "queryStringParameterOneValueTwo"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValueOne", "queryStringParameterOneValueTwo"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("OTHERQueryStringParameterOneName", "queryStringParameterOneValueOne", "queryStringParameterOneValueTwo"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValueOne", "queryStringParameterOneValueTwo"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValueOne", "queryStringParameterOneValueTwo"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValueOne", "queryStringParameterOneValueTwo"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("GET") .withPath(calculatePath("some_other_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_other_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withMethod("GET") .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_path")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")
.withMethod("POST") .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue") .withSecure(true) .withPath(calculatePath("some_pathRequest")) .withQueryStringParameters( param("queryStringParameterOneName", "queryStringParameterOneValue"), param("queryStringParameterTwoName", "queryStringParameterTwoValue")