@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://localhost:8089/record")
            .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");
}