HttpMessage extends DefaultMessage { public HttpMessage queryParam(final String name) { return queryParam(name, null); } 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 testNewQueryParamIsAddedQueryParamsHeader() { httpMessage.queryParam("foo", "foobar"); final String expectedHeaderValue = "bar=barbar,foo=foobar"; final HttpMessage resultMessage = httpMessage.queryParam("bar", "barbar"); assertEquals(resultMessage.getHeader(EndpointUriResolver.QUERY_PARAM_HEADER_NAME), expectedHeaderValue); }
@Test public void testNewQueryParamIsAddedQueryParamHeaderName() { httpMessage.queryParam("foo", "foobar"); final String expectedHeaderValue = "bar=barbar,foo=foobar"; final HttpMessage resultMessage = httpMessage.queryParam("bar", "barbar"); assertEquals(resultMessage.getHeader(EndpointUriResolver.QUERY_PARAM_HEADER_NAME), expectedHeaderValue); }
@Test public void testQueryParamWithMultipleParams() { httpMessage.queryParam("foo", "bar"); final String expectedHeaderValue = "foo=bar,foo=foobar"; final HttpMessage resultMessage= httpMessage.queryParam("foo", "foobar"); assertEquals(resultMessage.getHeader(EndpointUriResolver.QUERY_PARAM_HEADER_NAME), expectedHeaderValue); }