@Test public void onlyRepairNpmHostedRepositories() { when(repositoryManager.browse()).thenReturn(ImmutableList.of(npmHosted, npmProxy, npmGroup, nonNpmFormat)); List<Repository> repairedRepositories = new ArrayList<>(); NpmRepairPackageRootComponent repairComponent = new NpmRepairPackageRootComponent(repositoryManager, assetEntityAdapter, npmPackageParser, new HostedType(), new NpmFormat()) { @Override protected void beforeRepair(final Repository repository) { repairedRepositories.add(repository); } }; repairComponent.repair(); assertThat(repairedRepositories, is(equalTo(ImmutableList.of(npmHosted)))); }
public void repair() { log.info("Beginning processing all npm packages for repair"); stream(repositoryManager.browse().spliterator(), false) .filter(this::shouldRepairRepository) .forEach(this::doRepairRepository); }
NpmRepairPackageRootComponent extends RepairMetadataComponent { public void repair() { log.info("Beginning processing all npm packages for repair"); stream(repositoryManager.browse().spliterator(), false) .filter(this::shouldRepairRepository) .forEach(this::doRepairRepository); } }
NpmRepairPackageRootComponent extends RepairMetadataComponent { public void repair() { log.info("Beginning processing all npm packages for repair"); stream(repositoryManager.browse().spliterator(), false) .filter(this::shouldRepairRepository) .forEach(this::doRepairRepository); } @Inject  NpmRepairPackageRootComponent(final RepositoryManager repositoryManager,
                                       final AssetEntityAdapter assetEntityAdapter,
                                       final NpmPackageParser npmPackageParser,
                                       @Named(HostedType.NAME) final Type hostedType,
                                       @Named(NpmFormat.NAME) final Format npmFormat); }
NpmRepairPackageRootComponent extends RepairMetadataComponent { public void repair() { log.info("Beginning processing all npm packages for repair"); stream(repositoryManager.browse().spliterator(), false) .filter(this::shouldRepairRepository) .forEach(this::doRepairRepository); } @Inject  NpmRepairPackageRootComponent(final RepositoryManager repositoryManager,
                                       final AssetEntityAdapter assetEntityAdapter,
                                       final NpmPackageParser npmPackageParser,
                                       @Named(HostedType.NAME) final Type hostedType,
                                       @Named(NpmFormat.NAME) final Format npmFormat); void repair(); @Override void updateAsset(final Repository repository, final StorageTx tx, final Asset asset); }
NpmRepairPackageRootComponent extends RepairMetadataComponent { public void repair() { log.info("Beginning processing all npm packages for repair"); stream(repositoryManager.browse().spliterator(), false) .filter(this::shouldRepairRepository) .forEach(this::doRepairRepository); } @Inject  NpmRepairPackageRootComponent(final RepositoryManager repositoryManager,
                                       final AssetEntityAdapter assetEntityAdapter,
                                       final NpmPackageParser npmPackageParser,
                                       @Named(HostedType.NAME) final Type hostedType,
                                       @Named(NpmFormat.NAME) final Format npmFormat); void repair(); @Override void updateAsset(final Repository repository, final StorageTx tx, final Asset asset);  }