@Test
public void discoverApplicationsShouldReturnResourcesFoundByResourceLoader() throws Exception {

    //given
    givenExistingResourceFolder();
    Resource applicationResource = mock(Resource.class);
    given(resourceLoader.getResources(anyString())).willReturn(new Resource[]{applicationResource});
    //when
    List<Resource> resources = applicationDiscovery.discoverApplications();
    //then
    assertThat(resources).containsExactly(applicationResource);
}