@Test public void discoverApplicationsShouldReturnResourcesFoundByResourceLoader() throws Exception { givenExistingResourceFolder(); Resource applicationResource = mock(Resource.class); given(resourceLoader.getResources(anyString())).willReturn(new Resource[]{applicationResource}); List<Resource> resources = applicationDiscovery.discoverApplications(); assertThat(resources).containsExactly(applicationResource); }
public List<Resource> discoverApplications() { List<Resource> resources = new ArrayList<>(); Resource resource = resourceLoader.getResource(applicationsLocation); if (resource.exists()) { try { resources = Arrays.asList(resourceLoader.getResources(applicationsLocation + "**.zip")); } catch (IOException e) { throw new AppliationLoadException("Unable to load application resources", e); } } return resources; }
ApplicationDiscovery { public List<Resource> discoverApplications() { List<Resource> resources = new ArrayList<>(); Resource resource = resourceLoader.getResource(applicationsLocation); if (resource.exists()) { try { resources = Arrays.asList(resourceLoader.getResources(applicationsLocation + "**.zip")); } catch (IOException e) { throw new AppliationLoadException("Unable to load application resources", e); } } return resources; } }
ApplicationDiscovery { public List<Resource> discoverApplications() { List<Resource> resources = new ArrayList<>(); Resource resource = resourceLoader.getResource(applicationsLocation); if (resource.exists()) { try { resources = Arrays.asList(resourceLoader.getResources(applicationsLocation + "**.zip")); } catch (IOException e) { throw new AppliationLoadException("Unable to load application resources", e); } } return resources; } ApplicationDiscovery(ResourcePatternResolver resourceLoader,
                                String applicationsLocation); }
ApplicationDiscovery { public List<Resource> discoverApplications() { List<Resource> resources = new ArrayList<>(); Resource resource = resourceLoader.getResource(applicationsLocation); if (resource.exists()) { try { resources = Arrays.asList(resourceLoader.getResources(applicationsLocation + "**.zip")); } catch (IOException e) { throw new AppliationLoadException("Unable to load application resources", e); } } return resources; } ApplicationDiscovery(ResourcePatternResolver resourceLoader,
                                String applicationsLocation); List<Resource> discoverApplications(); }
ApplicationDiscovery { public List<Resource> discoverApplications() { List<Resource> resources = new ArrayList<>(); Resource resource = resourceLoader.getResource(applicationsLocation); if (resource.exists()) { try { resources = Arrays.asList(resourceLoader.getResources(applicationsLocation + "**.zip")); } catch (IOException e) { throw new AppliationLoadException("Unable to load application resources", e); } } return resources; } ApplicationDiscovery(ResourcePatternResolver resourceLoader,
                                String applicationsLocation); List<Resource> discoverApplications();  }