HttpMessage implements Message<T> { public String getMethod() { if (incomingHttpMetadata != null) { return incomingHttpMetadata.getMethod(); } return outgoingHttpMetadata.getMethod(); } HttpMessage(HttpRequestMetadata metadata, T payload, Supplier<CompletionStage<Void>> ack);   HttpMessage(String method, String url, T payload, Map<String, List<String>> query,
            Map<String, List<String>> headers, Supplier<CompletionStage<Void>> ack); static HttpMessageBuilder<T> builder(); @Override T getPayload(); String getMethod(); @Override CompletionStage<Void> ack(); @Override Metadata getMetadata(); Map<String, List<String>> getHeaders(); Map<String, List<String>> getQuery(); String getUrl();  }
@Test public void testHeadersAndUrlAndQuery() { stubFor(post(urlEqualTo("/items")) .willReturn(aResponse() .withStatus(404))); stubFor(post(urlPathMatching("/record?.*")) .willReturn(aResponse() .withStatus(204))); String uuid = UUID.randomUUID().toString(); HttpMessage<String> message = HttpMessage.HttpMessageBuilder.<String> create() .withHeader("X-foo", "value") .withUrl("http: .withQueryParameter("name", "clement") .withPayload(uuid) .build(); sink.send(message).subscribeAsCompletionStage(); awaitForRequest(); assertThat(bodies("/record?name=clement")).hasSize(1); LoggedRequest request = requests("/record?name=clement").get(0); assertThat(request.getBodyAsString()).isEqualTo(uuid); assertThat(request.getHeader("X-foo")).isEqualTo("value"); assertThat(request.getMethod().getName()).isEqualToIgnoringCase("POST"); QueryParameter name = request.getQueryParams().get("name"); assertThat(name).isNotNull(); assertThat(name.isSingleValued()).isTrue(); assertThat(name.firstValue()).isEqualToIgnoringCase("clement"); }