HttpMessage extends DefaultMessage { public void setCookies(final Cookie[] cookies) { this.cookies.clear(); if (cookies != null) { for (final Cookie cookie : cookies) { cookie(cookie); } } } HttpMessage();  HttpMessage(final Message message);  HttpMessage(final Object payload);  HttpMessage(final Object payload, final Map<String, Object> headers); HttpMessage method(final HttpMethod method); HttpMessage version(final String version); HttpMessage status(final HttpStatus statusCode); HttpMessage statusCode(final Integer statusCode); HttpMessage reasonPhrase(final String reasonPhrase); HttpMessage uri(final String requestUri); HttpMessage contentType(final String contentType); HttpMessage accept(final String accept); HttpMessage contextPath(final String contextPath); HttpMessage queryParams(final String queryParamString); HttpMessage queryParam(final String name); HttpMessage queryParam(final String name, final String value); HttpMessage path(final String path); HttpMessage header(final String headerName, final Object headerValue); @Override HttpMessage setHeader(final String headerName, final Object headerValue); @Override HttpMessage addHeaderData(final String headerData); HttpMethod getRequestMethod(); String getUri(); String getContextPath(); String getContentType(); String getAccept(); Map<String, Collection<String>> getQueryParams(); String getQueryParamString(); HttpStatus getStatusCode(); String getReasonPhrase(); String getVersion(); String getPath(); List<Cookie> getCookies(); void setCookies(final Cookie[] cookies); HttpMessage cookie(final Cookie cookie); static HttpMessage fromRequestData(final String requestData); static HttpMessage fromResponseData(final String responseData);  }
@Test public void testSetCookies() { final Cookie cookie = mock(Cookie.class); final Cookie[] cookies = new Cookie[]{cookie}; httpMessage.setCookies(cookies); assertTrue(httpMessage.getCookies().contains(cookie)); }