ArtifactFilesystemRepository extends AbstractArtifactRepository { @Override public void deleteBySha1(final String tenant, final String sha1Hash) { FileUtils.deleteQuietly(getFile(tenant, sha1Hash)); } ArtifactFilesystemRepository(final ArtifactFilesystemProperties artifactResourceProperties); @Override void deleteBySha1(final String tenant, final String sha1Hash); @Override ArtifactFilesystem getArtifactBySha1(final String tenant, final String sha1); @Override void deleteByTenant(final String tenant); @Override boolean existsByTenantAndSha1(final String tenant, final String sha1);  }
@Test @Description("Verfies that an artifact which does not exists is deleted quietly in the file-system repository") public void deleteArtifactWhichDoesNotExistsBySHA1HashWithoutException() { try { artifactFilesystemRepository.deleteBySha1(TENANT, "sha1HashWhichDoesNotExists"); } catch (final Exception e) { Assertions.fail("did not expect an exception while deleting a file which does not exists"); } final AbstractDbArtifact artifact = storeRandomArtifact(randomBytes()); try { artifactFilesystemRepository.deleteBySha1("tenantWhichDoesNotExist", artifact.getHashes().getSha1()); } catch (final Exception e) { Assertions.fail("did not expect an exception while deleting a file which does not exists"); } }