.withHeader(setCookieOneHeader.getName(), setCookieOneHeader.getValue()) .withHeader(setCookieTwoHeader.getName(), setCookieTwoHeader.getValue()) .withCookie("personalization_59996b985e24ce008d3df3bd07e27c1b", "") .withCookie("anonymous_59996b985e24ce008d3df3bd07e27c1b", "acgzEaAKOVR=mAY9yJhP7IrC9Am") .withBody("an_example_body"), exactly(1)
.withHeader("some", "header") .withQueryStringParameter("some", "parameter") .withCookie("some", "parameter") .withBody("some_body_one"); assertEquals(
public HttpRequest update(HttpRequest replaceRequest) { if (!Strings.isNullOrEmpty(replaceRequest.getMethod().getValue())) { withMethod(replaceRequest.getMethod()); } if (!Strings.isNullOrEmpty(replaceRequest.getPath().getValue())) { withPath(replaceRequest.getPath()); } for (Header header : replaceRequest.getHeaderList()) { getHeaders().replaceEntry(header); } for (Cookie cookie : replaceRequest.getCookieList()) { withCookie(cookie); } for (Parameter parameter : replaceRequest.getQueryStringParameterList()) { getQueryStringParameters().replaceEntry(parameter); } if (replaceRequest.getBody() != null) { withBody(replaceRequest.getBody()); } if (replaceRequest.isSecure() != null) { withSecure(replaceRequest.isSecure()); } if (replaceRequest.isKeepAlive() != null) { withKeepAlive(replaceRequest.isKeepAlive()); } return this; } }
request() .withPath(calculatePath("some_path")) .withCookie("name", "value") .withBody("some_request_body"), headersToIgnore) .withSecure(true) .withPath(calculatePath("some_path")) .withCookie("name", "value") .withBody("some_request_body"), headersToIgnore) request() .withPath(calculatePath("some_path")) .withCookie("name", "value") .withBody("some_request_body"), headersToIgnore) .withSecure(true) .withPath(calculatePath("some_path")) .withCookie("name", "value") .withBody("some_request_body"), headersToIgnore)
request() .withPath(calculatePath("some_path")) .withCookie("name", "value") .withBody("some_request_body"), headersToIgnore) .withSecure(true) .withPath(calculatePath("some_path")) .withCookie("name", "value") .withBody("some_request_body"), headersToIgnore)
.withHeader("some", "header") .withQueryStringParameter("some", "parameter") .withCookie("some", "parameter") .withBody("some_body"); mockServerClient.when(complexRequest, exactly(4))
public HttpRequest update(HttpRequest replaceRequest) { if (!Strings.isNullOrEmpty(replaceRequest.getMethod().getValue())) { withMethod(replaceRequest.getMethod()); } if (!Strings.isNullOrEmpty(replaceRequest.getPath().getValue())) { withPath(replaceRequest.getPath()); } for (Header header : replaceRequest.getHeaderList()) { getHeaders().replaceEntry(header); } for (Cookie cookie : replaceRequest.getCookieList()) { withCookie(cookie); } for (Parameter parameter : replaceRequest.getQueryStringParameterList()) { getQueryStringParameters().replaceEntry(parameter); } if (replaceRequest.getBody() != null) { withBody(replaceRequest.getBody()); } if (replaceRequest.isSecure() != null) { withSecure(replaceRequest.isSecure()); } if (replaceRequest.isKeepAlive() != null) { withKeepAlive(replaceRequest.isKeepAlive()); } return this; } }