@Test
public void testWriteShouldAppendStatusCodeToWriter() throws IOException {

    //GIVEN
    doReturn(OUTPUT_FILE).when(underTest).getOutputFileName(MESSAGE_ID, true);
    given(bufferedWriterFactory.createBufferedWriter(OUTPUT_FILE, OUTPUT_BUFFER_SIZE)).willReturn(bufferedWriter);
    given(response.getWilmaMessageLoggerId()).willReturn(MESSAGE_ID);
    given(response.getStatusCode()).willReturn(200);
    //WHEN
    underTest.write(response, true);
    //THEN
    verify(bufferedWriter).append("Status code:200");
}