@Test
public void testSearchForFilesWhenIndexIsNotReady() throws IOException {

    //GIVEN
    given(indexStatus.isReady()).willReturn(false);
    //WHEN
    ResponseEntity<String> result = underTest.searchForFiles("test", session);
    //THEN
    Assert.assertEquals(result.getStatusCode(), HttpStatus.PARTIAL_CONTENT);
    verify(luceneEngine).search("test");
    verify(fileChecker).checkFilesExistsWithPairs(lucineResult);
    verify(session).setAttribute("searchResult", listOfLists);
}