@Test
public void testIndexFileShouldUpdateIndexWhenWriterInAppendMode() throws IOException {

    //GIVEN
    given(writer.getConfig().getOpenMode()).willReturn(OpenMode.APPEND);
    given(file.getPath()).willReturn("path");
    given(termFactory.createTerm(FIELD_NAME, "path")).willReturn(term);
    //WHEN
    underTest.indexFile(file);
    //THEN
    verify(writer).updateDocument(term, document);
}