@Test
public void testLogRequest(TestContext context){

    EventBus eventBus = Mockito.mock(EventBus .class);
    CaseInsensitiveHeaders headers = new CaseInsensitiveHeaders();
    headers.add("Content-Type", "application/json");
    headers.add("x-rp-unique-id", "123456");
    MockedResponse response = new MockedResponse(new CaseInsensitiveHeaders());
    MockedRequest request = new MockedRequest("/uri/to/a/resource", HttpMethod.PUT, headers, response);
    JsonObject body = new JsonObject().put("key_1", "value_2").put("key_2", 99);
    RequestLogger.logRequest(eventBus, request, StatusCode.OK.getStatusCode(), Buffer.buffer(body.encode()));
    JsonObject expected = new JsonObject();
    expected.put(REQUEST_URI, "/uri/to/a/resource");
    expected.put(REQUEST_METHOD, "PUT");
    JsonObject requestHeaders = new JsonObject().put("Content-Type", "application/json").put("x-rp-unique-id", "123456");
    expected.put(REQUEST_HEADERS, requestHeaders);
    expected.put(RESPONSE_HEADERS, new JsonObject());
    expected.put(REQUEST_STATUS, StatusCode.OK.getStatusCode());
    expected.put(BODY, Buffer.buffer(body.encode()).toString());
    Mockito.verify(eventBus, Mockito.times(1))
            .send(eq(Address.requestLoggingConsumerAddress()), eq(expected), any(Handler.class));
}