@Test(expectedExceptions = QueryCannotBeParsedException.class)
public void testSearchForTextWhenCannotParseQueryShouldThrowError() throws IOException, ParseException {

    //GIVEN
    given(readerFactory.create(true)).willReturn(indexReader);
    given(searcherFactory.create(indexReader)).willReturn(indexSearcher);
    given(queryParser.parse(TEXT)).willThrow(new ParseException());
    //WHEN
    underTest.searchForText(TEXT);
    //THEN it should throw exception
}