@Test public void errorsIfBlobSha1DisagreesWithDb() { mockAssetBrowse(); mockAssetReload(); when(blob.getMetrics()).thenReturn(blobMetrics); when(blob.getInputStream()).thenReturn(blobStream); when(assetBlob.checksums()).thenReturn(Collections.singletonMap(HashAlgorithm.SHA1.toString(), "1235")); List<DeadBlobResult<Asset>> result = deadBlobFinder.find(repository); assertThat(result, hasSize(1)); assertThat(result.get(0).getAsset().path(), is("foo")); assertThat(result.get(0).getResultState(), is(SHA1_DISAGREEMENT)); }
@Override public List<DeadBlobResult<Asset>> find(@NotNull final Repository repository, final boolean ignoreMissingBlobRefs) { checkNotNull(repository); List<DeadBlobResult<Asset>> deadBlobCandidates = identifySuspects(repository, ignoreMissingBlobRefs); return verifySuspects(deadBlobCandidates, repository); }
DatastoreDeadBlobFinder extends ComponentSupport implements DeadBlobFinder<Asset> { @Override public List<DeadBlobResult<Asset>> find(@NotNull final Repository repository, final boolean ignoreMissingBlobRefs) { checkNotNull(repository); List<DeadBlobResult<Asset>> deadBlobCandidates = identifySuspects(repository, ignoreMissingBlobRefs); return verifySuspects(deadBlobCandidates, repository); } }
DatastoreDeadBlobFinder extends ComponentSupport implements DeadBlobFinder<Asset> { @Override public List<DeadBlobResult<Asset>> find(@NotNull final Repository repository, final boolean ignoreMissingBlobRefs) { checkNotNull(repository); List<DeadBlobResult<Asset>> deadBlobCandidates = identifySuspects(repository, ignoreMissingBlobRefs); return verifySuspects(deadBlobCandidates, repository); } @Inject  DatastoreDeadBlobFinder(final BlobStoreManager blobStoreManager); }
DatastoreDeadBlobFinder extends ComponentSupport implements DeadBlobFinder<Asset> { @Override public List<DeadBlobResult<Asset>> find(@NotNull final Repository repository, final boolean ignoreMissingBlobRefs) { checkNotNull(repository); List<DeadBlobResult<Asset>> deadBlobCandidates = identifySuspects(repository, ignoreMissingBlobRefs); return verifySuspects(deadBlobCandidates, repository); } @Inject  DatastoreDeadBlobFinder(final BlobStoreManager blobStoreManager); @Override List<DeadBlobResult<Asset>> find(@NotNull final Repository repository, final boolean ignoreMissingBlobRefs); }
DatastoreDeadBlobFinder extends ComponentSupport implements DeadBlobFinder<Asset> { @Override public List<DeadBlobResult<Asset>> find(@NotNull final Repository repository, final boolean ignoreMissingBlobRefs) { checkNotNull(repository); List<DeadBlobResult<Asset>> deadBlobCandidates = identifySuspects(repository, ignoreMissingBlobRefs); return verifySuspects(deadBlobCandidates, repository); } @Inject  DatastoreDeadBlobFinder(final BlobStoreManager blobStoreManager); @Override List<DeadBlobResult<Asset>> find(@NotNull final Repository repository, final boolean ignoreMissingBlobRefs);  }