private void setCookies(HttpRequest httpRequest, HttpServletRequest httpServletRequest) { Cookies cookies = new Cookies(); if (httpServletRequest.getCookies() != null) { for (javax.servlet.http.Cookie cookie : httpServletRequest.getCookies()) { cookies.withEntry(new Cookie(cookie.getName(), cookie.getValue())); } } httpRequest.withCookies(cookies); }
private void setCookies(HttpRequest httpRequest, FullHttpRequest fullHttpResponse) { Cookies cookies = new Cookies(); for (String cookieHeader : fullHttpResponse.headers().getAll(COOKIE)) { Set<io.netty.handler.codec.http.cookie.Cookie> decodedCookies = ServerCookieDecoder.LAX.decode(cookieHeader); for (io.netty.handler.codec.http.cookie.Cookie decodedCookie : decodedCookies) { cookies.withEntry(new Cookie( decodedCookie.name(), decodedCookie.value() )); } } httpRequest.withCookies(cookies); }
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("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie(not("requestCookieNameOne"), not("requestCookieValueOne")), cookie("requestCookieNameTwo", "requestCookieValueTwo") .withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie("requestCookieNameOne", "requestCookieValueOne"), cookie("requestCookieNameTwo", "requestCookieValueTwo") .withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie("requestCookieNameOne", "requestCookieValueOne"), cookie("requestCookieNameTwo", "requestCookieValueTwo")
.withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie(string("requestCookieNameOne"), not("requestCookieValueOne")), cookie("requestCookieNameTwo", "requestCookieValueTwo") .withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie("requestCookieNameOne", "OTHERrequestCookieValueOne"), cookie("requestCookieNameTwo", "requestCookieValueTwo")
.withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie(not("requestCookieNameOne"), string("requestCookieValueOne")), cookie("requestCookieNameTwo", "requestCookieValueTwo") .withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie("OTHERrequestCookieNameOne", "requestCookieValueOne"), cookie("requestCookieNameTwo", "requestCookieValueTwo")
.withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie(not("requestCookieNameOne"), not("requestCookieValueOne")), cookie("requestCookieNameTwo", "requestCookieValueTwo") .withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie("OTHERrequestCookieNameOne", "requestCookieValueOne"), cookie("requestCookieNameTwo", "requestCookieValueTwo") .withMethod("GET") .withPath(calculatePath("some_pathRequest")) .withCookies( cookie("requestCookieNameOne", "OTHERrequestCookieValueOne"), cookie("requestCookieNameTwo", "requestCookieValueTwo")
.withCookies(cookie("cookieName", "cookieValue")) .withCookies(cookie("cookieOtherName", "cookieValue")), headersToIgnore) ); .withCookies(cookie("cookieOtherName", "cookieValue")), headersToIgnore) );
.withCookies(cookie("cookieName", "cookieValue")) .withCookies(cookie("cookieName", "cookieValue")), headersToIgnore) ); .withCookies(cookie("cookieName", "cookieValue")), headersToIgnore) );
.withCookies(cookie("cookieName", "cookieValue")) .withCookies(cookie("cookieName", "cookieOtherValue")), headersToIgnore) ); .withCookies(cookie("cookieName", "cookieOtherValue")), headersToIgnore) );
.withCookies(cookie("cookieName", "cookieValue")) .withCookies(cookie("cookieName", "cookieValue")), headersToIgnore) ); .withCookies(cookie("cookieName", "cookieValue")), headersToIgnore) );
.withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) ); .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) );
)) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) ); "&bodyParameterTwoName=Parameter+Two")) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) );
)) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) ); "&bodyParameterTwoName=Parameter+Two")) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) );
)) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) ); "&bodyParameterTwoName=Parameter+Two")) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) );
)) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) ); "&bodyParameterTwoName=Parameter+Two")) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) );
)) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) ); "&bodyParameterTwoName=Parameter+Two")) .withHeaders(header("headerNameRequest", "headerValueRequest")) .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) );
.withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) );
header("headerNameRequest", "headerValueRequest") .withCookies(cookie("cookieNameRequest", "cookieValueRequest")), headersToIgnore) );