@Test
public void testFinishWrite_success() throws Exception {

    doCallRealMethod().when(reader).finishWrite(any(FileOutputStream.class));
    when(workFile.renameTo(activeFile)).thenReturn(true);
    try {
        reader.finishWrite(fos);
        Mockito.verify(fos).close();
    } catch (IOException e) {
        fail("Successful rename commits transaction");
    }
}