@Test
public void testRequest() {

    // given
    Mockito.when(event.getRequestURI()).thenReturn("uri");
    Mockito.when(event.getProtocol()).thenReturn("protocol");
    Mockito.when(event.getMethod()).thenReturn("method");
    Mockito.when(event.getRequestContent()).thenReturn("postContent");
    Mockito.when(event.getCookie("JSESSIONID")).thenReturn("sessionId");
    Mockito.when(event.getRequestHeader("User-Agent")).thenReturn("userAgent");
    Mockito.when(event.getRequestHeader("Referer")).thenReturn("referer");
    // when
    final BasicDBObject dbObject = appender.toMongoDocument(event);
    // then
    BasicDBObject requestDBObject = (BasicDBObject) dbObject.get("request");
    assertEquals("uri", requestDBObject.getString("uri"));
    assertEquals("protocol", requestDBObject.getString("protocol"));
    assertEquals("method", requestDBObject.getString("method"));
    assertEquals("postContent", requestDBObject.getString("postContent"));
    assertEquals("sessionId", requestDBObject.getString("sessionId"));
    assertEquals("userAgent", requestDBObject.getString("userAgent"));
    assertEquals("referer", requestDBObject.getString("referer"));
}