@Test
public void testReindexShouldRunReindexThenExceptionRaisedInGetWriter() throws IOException {

    //GIVEN
    IOException exception = new IOException();
    doThrow(exception).when(response).getWriter();
    //WHEN
    underTest.reindex(response);
    //THEN
    verify(indexTaskScheduler).runReindexOnDemand();
    verify(logger).info("error occurred when accessing /reindex", exception);
}