@Test public void getDDArtifactOnlyFullGAVC() { final Delivery delivery = DataModelFactory.createDelivery(SAMPLE_NAME, SAMPLE_VERSION, LocalDate.now().toString(), Arrays.asList("a1:a2:a3:a4", "b1:b2:b3:b4", "c1:c2:c3:c4")); final RepositoryHandler repoHandler = mock(RepositoryHandler.class); when(repoHandler.getModule(anyString())).thenReturn(null); final DataFetchingUtils sut = new DataFetchingUtils(); final Set<String> deliveryDependencies = sut.getDeliveryDependencies(repoHandler, mock(DependencyHandler.class), delivery); assertEquals(3, deliveryDependencies.size()); assertTrue(deliveryDependencies.contains("a1:a2")); assertTrue(deliveryDependencies.contains("b1:b2")); assertTrue(deliveryDependencies.contains("c1:c2")); }
public Set<String> getDeliveryDependencies(final RepositoryHandler repoHandler, final DependencyHandler depHandler, final Delivery delivery) { final FiltersHolder filters = new FiltersHolder(); filters.getDecorator().setShowCorporate(Boolean.FALSE); filters.getDecorator().setShowThirdparty(Boolean.TRUE); Set<String> deps = new HashSet<>(); delivery.getDependencies().forEach(d -> { final DbModule module = repoHandler.getModule(d); if (module != null) { final List<Dependency> allDependencies = depHandler.getModuleDependencies(module.getId(), filters); allDependencies.forEach(dep -> deps.add(dep.getTarget().getGavc())); } else { if(isFullGAVC(d)) { deps.add(strip(d, 2)); } else { deps.add(d); } } }); return deps; }
DataFetchingUtils { public Set<String> getDeliveryDependencies(final RepositoryHandler repoHandler, final DependencyHandler depHandler, final Delivery delivery) { final FiltersHolder filters = new FiltersHolder(); filters.getDecorator().setShowCorporate(Boolean.FALSE); filters.getDecorator().setShowThirdparty(Boolean.TRUE); Set<String> deps = new HashSet<>(); delivery.getDependencies().forEach(d -> { final DbModule module = repoHandler.getModule(d); if (module != null) { final List<Dependency> allDependencies = depHandler.getModuleDependencies(module.getId(), filters); allDependencies.forEach(dep -> deps.add(dep.getTarget().getGavc())); } else { if(isFullGAVC(d)) { deps.add(strip(d, 2)); } else { deps.add(d); } } }); return deps; } }
DataFetchingUtils { public Set<String> getDeliveryDependencies(final RepositoryHandler repoHandler, final DependencyHandler depHandler, final Delivery delivery) { final FiltersHolder filters = new FiltersHolder(); filters.getDecorator().setShowCorporate(Boolean.FALSE); filters.getDecorator().setShowThirdparty(Boolean.TRUE); Set<String> deps = new HashSet<>(); delivery.getDependencies().forEach(d -> { final DbModule module = repoHandler.getModule(d); if (module != null) { final List<Dependency> allDependencies = depHandler.getModuleDependencies(module.getId(), filters); allDependencies.forEach(dep -> deps.add(dep.getTarget().getGavc())); } else { if(isFullGAVC(d)) { deps.add(strip(d, 2)); } else { deps.add(d); } } }); return deps; }  }
DataFetchingUtils { public Set<String> getDeliveryDependencies(final RepositoryHandler repoHandler, final DependencyHandler depHandler, final Delivery delivery) { final FiltersHolder filters = new FiltersHolder(); filters.getDecorator().setShowCorporate(Boolean.FALSE); filters.getDecorator().setShowThirdparty(Boolean.TRUE); Set<String> deps = new HashSet<>(); delivery.getDependencies().forEach(d -> { final DbModule module = repoHandler.getModule(d); if (module != null) { final List<Dependency> allDependencies = depHandler.getModuleDependencies(module.getId(), filters); allDependencies.forEach(dep -> deps.add(dep.getTarget().getGavc())); } else { if(isFullGAVC(d)) { deps.add(strip(d, 2)); } else { deps.add(d); } } }); return deps; }  List<DbProduct> getProductWithCommercialDeliveries(final RepositoryHandler repoHandler); Optional<Delivery> getCommercialDelivery(final RepositoryHandler repoHandler,
                                                    final String name,
                                                    final String version); Set<String> getDeliveryDependencies(final RepositoryHandler repoHandler,
                                               final DependencyHandler depHandler,
                                               final Delivery delivery); void initCorporateIDs(final RepositoryHandler repoHandler,
                                 final String orgName); boolean isThirdParty(final DbArtifact artifact); }
DataFetchingUtils { public Set<String> getDeliveryDependencies(final RepositoryHandler repoHandler, final DependencyHandler depHandler, final Delivery delivery) { final FiltersHolder filters = new FiltersHolder(); filters.getDecorator().setShowCorporate(Boolean.FALSE); filters.getDecorator().setShowThirdparty(Boolean.TRUE); Set<String> deps = new HashSet<>(); delivery.getDependencies().forEach(d -> { final DbModule module = repoHandler.getModule(d); if (module != null) { final List<Dependency> allDependencies = depHandler.getModuleDependencies(module.getId(), filters); allDependencies.forEach(dep -> deps.add(dep.getTarget().getGavc())); } else { if(isFullGAVC(d)) { deps.add(strip(d, 2)); } else { deps.add(d); } } }); return deps; }  List<DbProduct> getProductWithCommercialDeliveries(final RepositoryHandler repoHandler); Optional<Delivery> getCommercialDelivery(final RepositoryHandler repoHandler,
                                                    final String name,
                                                    final String version); Set<String> getDeliveryDependencies(final RepositoryHandler repoHandler,
                                               final DependencyHandler depHandler,
                                               final Delivery delivery); void initCorporateIDs(final RepositoryHandler repoHandler,
                                 final String orgName); boolean isThirdParty(final DbArtifact artifact);  }