@Test
public void testSearchForFilesWhenQueryIsNotValid() throws IOException {

    //GIVEN
    given(luceneEngine.search("test")).willThrow(new QueryCannotBeParsedException("Parse Exception"));
    //WHEN
    ResponseEntity<String> result = underTest.searchForFiles("test", session);
    //THEN
    Assert.assertEquals(result.getStatusCode(), HttpStatus.BAD_REQUEST);
}