Skip to content

Commit

Permalink
Provide artifact last modified timestamp on DMF API (#1470)
Browse files Browse the repository at this point in the history
Sets lastModified filed of DmfArtifact DTO according to artifact's last modification timestamp so it is server over DMF.

Signed-off-by: Ondrej Charvat <ondrej.charvat@proton.me>
  • Loading branch information
charvadzo authored Jan 22, 2024
1 parent 4f63a66 commit af56b71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ private DmfArtifact convertArtifact(final Target target, final Artifact localArt
artifact.setFilename(localArtifact.getFilename());
artifact.setHashes(new DmfArtifactHash(localArtifact.getSha1Hash(), localArtifact.getMd5Hash()));
artifact.setSize(localArtifact.getSize());
artifact.setLastModified(localArtifact.getLastModifiedAt());
return artifact;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ void testSendDownloadRequest() {
assertThat(found.get().getSize()).isEqualTo(dbArtifact.getSize());
assertThat(found.get().getHashes().getMd5()).isEqualTo(dbArtifact.getMd5Hash());
assertThat(found.get().getHashes().getSha1()).isEqualTo(dbArtifact.getSha1Hash());
assertThat(found.get().getLastModified()).isGreaterThan(0L);
});
}
}
Expand Down

0 comments on commit af56b71

Please sign in to comment.