HttpMessage extends DefaultMessage { public HttpMessage queryParams(final String queryParamString) { header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParamString); header(EndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParamString); Stream.of(queryParamString.split(",")) .map(keyValue -> Optional.ofNullable(StringUtils.split(keyValue, "=")).orElse(new String[]{keyValue, ""})) .filter(keyValue -> StringUtils.hasText(keyValue[0])) .forEach(keyValue -> this.addQueryParam(keyValue[0], keyValue[1])); return this; } 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 testParseQueryParamsSetsQueryParamsHeader() { final String queryParamString = "foo=foobar,bar=barbar"; final HttpMessage resultMessage = httpMessage.queryParams(queryParamString); assertEquals(resultMessage.getHeader(HttpMessageHeaders.HTTP_QUERY_PARAMS), queryParamString); }
@Test public void testParseQueryParamsSetsQueryParamHeaderName() { final String queryParamString = "foo=foobar,bar=barbar"; final HttpMessage resultMessage = httpMessage.queryParams(queryParamString); assertEquals(resultMessage.getHeader(EndpointUriResolver.QUERY_PARAM_HEADER_NAME), queryParamString); }