@Test
void shouldLogRequest() throws IOException {

    final String correlationId = "c9408eaa-677d-11e5-9457-10ddb1ee7671";
    final HttpRequest request = MockHttpRequest.create()
            .withProtocolVersion("HTTP/1.0")
            .withOrigin(Origin.REMOTE)
            .withPath("/test")
            .withQuery("limit=1")
            .withHeaders(HttpHeaders.empty()
                    .update("Accept", "application/json")
                    .update("Content-Type", "text/plain"))
            .withBodyAsString("Hello, world!");
    final HttpLogFormatter unit = new CurlHttpLogFormatter();
    final String curl = unit.format(new SimplePrecorrelation(correlationId, systemUTC()), request);
    assertThat(curl, is("c9408eaa-677d-11e5-9457-10ddb1ee7671 " +
            "curl -v -X GET 'http://localhost/test?limit=1' -H 'Accept: application/json' -H 'Content-Type: text/plain' --data-binary 'Hello, world!'"));
}