@Test
public void testWriteShouldCloseOutputStream() throws IOException {

    //GIVEN
    given(file.getParent()).willReturn(DIRECTORIES);
    given(fileOutputStreamFactory.createFileOutputStream(file)).willReturn(fileOutputStream);
    //WHEN
    underTest.write(inputStream, FILE_NAME, EXCEPTION_MESSAGE);
    //THEN
    verify(fileOutputStream).close();
}