@Test
void parse() throws Throwable {

    byte[] body = Strings.bytes("{}");
    var actionLog = new ActionLog(null, null);
    var exchange = new HttpServerExchange(null);
    exchange.setRequestMethod(Methods.POST);
    exchange.getRequestHeaders().put(Headers.HOST, "localhost");
    exchange.setDestinationAddress(new InetSocketAddress(80));
    exchange.setSourceAddress(new InetSocketAddress(10000));
    exchange.getRequestHeaders().put(Headers.CONTENT_LENGTH, body.length);
    exchange.putAttachment(RequestBodyReader.REQUEST_BODY, new RequestBodyReader.RequestBody(body, null));
    var request = new RequestImpl(exchange, null);
    request.contentType = ContentType.TEXT_XML;
    parser.parse(request, exchange, actionLog);
    assertThat(request.method).isEqualTo(HTTPMethod.POST);
    assertThat(request.body()).hasValue(body);
    assertThat(actionLog.stats).containsKeys("http_content_length");
}