@Test
public void discoverApplicationsShouldThrowApplicationLoadExceptionWhenIOExceptionOccurs() throws IOException {

    //given
    givenExistingResourceFolder();
    IOException ioException = new IOException();
    given(resourceLoader.getResources(anyString())).willThrow(ioException);
    //when
    Throwable thrown = catchThrowable(() -> applicationDiscovery.discoverApplications());
    //then
    assertThat(thrown)
            .isInstanceOf(AppliationLoadException.class)
            .hasCause(ioException);
}