@Test public void getModuleDependenciesOnAModuleThatDoesNotHaveAny(){ final DbModule module = new DbModule(); module.setName("module"); module.setVersion("1.0.0"); final RepositoryHandler repositoryHandler = mock(RepositoryHandler.class); when(repositoryHandler.getModule(module.getId())).thenReturn(module); final DependencyHandler dependencyHandler = new DependencyHandler(repositoryHandler); final List<Dependency> dependencies = dependencyHandler.getModuleDependencies(module.getId(), mock(FiltersHolder.class)); assertNotNull(dependencies); assertEquals(0, dependencies.size()); }
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);  }