@Test
public void shouldFailToLoadCache() throws IOException {

  reset(projectsList);
  final IOException exception = new IOException();
  doThrow(exception).when(projectsList).execute();
  try {
    validator.cacheResources();
    fail("Expected exception");
  } catch (IOException e) {
    assertThat(e.getCause().getCause(), is(exception));
  }
  verify(projectsList, times(3)).execute();
}