@Test
public void shouldLoadApplications() throws Exception {

    //given
    Resource applicationResource = mock(Resource.class);
    given(applicationResource.getInputStream()).willReturn(mock(InputStream.class));
    given(applicationDiscovery.discoverApplications()).willReturn(Collections.singletonList(applicationResource));
    ApplicationContent applicationContent = new ApplicationContent();
    given(applicationReader.read(applicationResource.getInputStream())).willReturn(applicationContent);
    //when
    List<ApplicationContent> applicationContents = applicationService.loadApplications();
    //then
    assertThat(applicationContents).containsExactly(applicationContent);
}