@Test public void getModuleDependenciesOnAModuleThatDoesNotExist(){ final RepositoryHandler repositoryHandler = mock(RepositoryHandler.class); final DependencyHandler dependencyHandler = new DependencyHandler(repositoryHandler); WebApplicationException exception = null; try{ dependencyHandler.getModuleDependencies("doesNotExist", mock(FiltersHolder.class)); } catch (WebApplicationException e){ exception = e; } assertNotNull(exception); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), exception.getResponse().getStatus()); }
public List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters){ final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); return getModuleDependencies(module, filters, 1, new ArrayList<String>()); }
DependencyHandler { public List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters){ final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); return getModuleDependencies(module, filters, 1, new ArrayList<String>()); } }
DependencyHandler { public List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters){ final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); return getModuleDependencies(module, filters, 1, new ArrayList<String>()); } DependencyHandler(final RepositoryHandler repositoryHandler); }
DependencyHandler { public List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters){ final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); return getModuleDependencies(module, filters, 1, new ArrayList<String>()); } DependencyHandler(final RepositoryHandler repositoryHandler); List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters); DependencyReport getDependencyReport(final String moduleId, final FiltersHolder filters); }
DependencyHandler { public List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters){ final DbModule module = moduleHandler.getModule(moduleId); final DbOrganization organization = moduleHandler.getOrganization(module); filters.setCorporateFilter(new CorporateFilter(organization)); return getModuleDependencies(module, filters, 1, new ArrayList<String>()); } DependencyHandler(final RepositoryHandler repositoryHandler); List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters); DependencyReport getDependencyReport(final String moduleId, final FiltersHolder filters);  }