@Test
public void testWriteShouldWriteContentToWriter() throws IOException {

    //GIVEN
    doReturn(OUTPUT_FILE).when(underTest).getOutputFileName(MESSAGE_LOGGER_ID, true);
    given(bufferedWriterFactory.createBufferedWriter(OUTPUT_FILE, OUTPUT_BUFFER_SIZE)).willReturn(bufferedWriter);
    given(request.getWilmaMessageLoggerId()).willReturn(MESSAGE_LOGGER_ID);
    given(request.getWilmaMessageId()).willReturn(MESSAGE_ID);
    given(request.getRequestLine()).willReturn(REQUEST_LINE);
    given(request.getRemoteAddr()).willReturn(REMOTE_ADDR);
    given(request.getBody()).willReturn(BODY);
    //WHEN
    underTest.write(request, true);
    //THEN
    verify(bufferedWriter).append(REMOTE_ADDR + " " + REQUEST_LINE);
    verify(bufferedWriter).append(WilmaHttpRequest.WILMA_LOGGER_ID + ":" + MESSAGE_ID);
    verify(bufferedWriter).append("{" + HEADERS + "=" + HEADERS
            + "}\n+{" + EXTRA_HEADERS + "=" + EXTRA_HEADERS + "}\n-[" + EXTRA_HEADERS_REMOVE + "]");
    verify(bufferedWriter).append(BODY);
}