@Test public void processBatchIteratesUntilNullReturned() { int timesToIterate = 2; underTest = new RepairMetadataComponentForTest(repositoryManager, assetEntityAdapter, type, format) { private int iterated = 0; @Nullable @Override protected String processBatchWith(final Repository repository, final String lastId, final BiFunction<Repository, Iterable<Asset>, String> function) throws Exception { this.called++; if (iterated++ == timesToIterate) { return null; } else { return ""; } } }; underTest.doRepairRepository(repository); assertThat(underTest.called, is(3)); }
protected void doRepairRepository(final Repository repository) { beforeRepair(repository); doRepairRepositoryWith(repository, this::updateAssets); afterRepair(repository); log.info("Finished processing all {} packages for repair", repository.getFormat()); }
RepairMetadataComponent extends ComponentSupport { protected void doRepairRepository(final Repository repository) { beforeRepair(repository); doRepairRepositoryWith(repository, this::updateAssets); afterRepair(repository); log.info("Finished processing all {} packages for repair", repository.getFormat()); } }
RepairMetadataComponent extends ComponentSupport { protected void doRepairRepository(final Repository repository) { beforeRepair(repository); doRepairRepositoryWith(repository, this::updateAssets); afterRepair(repository); log.info("Finished processing all {} packages for repair", repository.getFormat()); } RepairMetadataComponent(final RepositoryManager repositoryManager,
                                 final AssetEntityAdapter assetEntityAdapter,
                                 final Type type,
                                 final Format format); }
RepairMetadataComponent extends ComponentSupport { protected void doRepairRepository(final Repository repository) { beforeRepair(repository); doRepairRepositoryWith(repository, this::updateAssets); afterRepair(repository); log.info("Finished processing all {} packages for repair", repository.getFormat()); } RepairMetadataComponent(final RepositoryManager repositoryManager,
                                 final AssetEntityAdapter assetEntityAdapter,
                                 final Type type,
                                 final Format format); void repairRepository(final Repository repository); }
RepairMetadataComponent extends ComponentSupport { protected void doRepairRepository(final Repository repository) { beforeRepair(repository); doRepairRepositoryWith(repository, this::updateAssets); afterRepair(repository); log.info("Finished processing all {} packages for repair", repository.getFormat()); } RepairMetadataComponent(final RepositoryManager repositoryManager,
                                 final AssetEntityAdapter assetEntityAdapter,
                                 final Type type,
                                 final Format format); void repairRepository(final Repository repository);  }