@Test(expectedExceptions = SystemException.class)
public void testDeleteDocFromIndexWhenCannotDeleteShouldThrowException() throws IOException {

    //GIVEN
    given(termFactory.createTerm(FIELD_NAME, TEXT)).willReturn(term);
    willThrow(new IOException()).given(indexWriter).deleteDocuments(term);
    //WHEN
    underTest.deleteDocFromIndex(TEXT);
    //THEN it should throw exceptions
}