@Test public void testCorrectArgsForCommercialDeliveryList() { final RepositoryHandler repoHandler = mock(RepositoryHandler.class); final DataFetchingUtils sut = new DataFetchingUtils(); sut.getProductWithCommercialDeliveries(repoHandler); ArgumentCaptor<String> nameCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> queryCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<Class> classCaptor = ArgumentCaptor.forClass(Class.class); verify(repoHandler, times(1)).getListByQuery( nameCaptor.capture(), queryCaptor.capture(), classCaptor.capture()); assertEquals(DbCollections.DB_PRODUCT, nameCaptor.getValue()); assertEquals("{'deliveries.0' : {$exists: true}}", queryCaptor.getValue()); assertEquals(DbProduct.class, classCaptor.getValue()); }
public List<DbProduct> getProductWithCommercialDeliveries(final RepositoryHandler repoHandler) { return repoHandler.getListByQuery( DbCollections.DB_PRODUCT, QueryUtils.makeQueryAllDeliveries(), DbProduct.class); }
DataFetchingUtils { public List<DbProduct> getProductWithCommercialDeliveries(final RepositoryHandler repoHandler) { return repoHandler.getListByQuery( DbCollections.DB_PRODUCT, QueryUtils.makeQueryAllDeliveries(), DbProduct.class); } }
DataFetchingUtils { public List<DbProduct> getProductWithCommercialDeliveries(final RepositoryHandler repoHandler) { return repoHandler.getListByQuery( DbCollections.DB_PRODUCT, QueryUtils.makeQueryAllDeliveries(), DbProduct.class); }  }
DataFetchingUtils { public List<DbProduct> getProductWithCommercialDeliveries(final RepositoryHandler repoHandler) { return repoHandler.getListByQuery( DbCollections.DB_PRODUCT, QueryUtils.makeQueryAllDeliveries(), DbProduct.class); }  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 List<DbProduct> getProductWithCommercialDeliveries(final RepositoryHandler repoHandler) { return repoHandler.getListByQuery( DbCollections.DB_PRODUCT, QueryUtils.makeQueryAllDeliveries(), DbProduct.class); }  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);  }