ArtifactFilesystemRepository extends AbstractArtifactRepository { @Override public ArtifactFilesystem getArtifactBySha1(final String tenant, final String sha1) { final File file = getFile(tenant, sha1); if (!file.exists()) { return null; } return new ArtifactFilesystem(file, sha1, new DbArtifactHash(sha1, null, null), file.length(), null); } 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 can be successfully stored in the file-system repository") public void getStoredArtifactBasedOnSHA1Hash() { final byte[] fileContent = randomBytes(); final AbstractDbArtifact artifact = storeRandomArtifact(fileContent); final AbstractDbArtifact artifactBySha1 = artifactFilesystemRepository.getArtifactBySha1(TENANT, artifact.getHashes().getSha1()); assertThat(artifactBySha1).isNotNull(); }