@Test
void shouldEscape() 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("char='")
            .withHeaders(HttpHeaders.of("Foo'Bar", "Baz"))
            .withBodyAsString("{\"message\":\"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?char=\\'' -H 'Foo\\'Bar: Baz' --data-binary '{\"message\":\"Hello, \\'world\\'!\"}'"));
}