Skip to content

Commit

Permalink
Update 'syncPutObject' to call '.setPid()' and update junit test
Browse files Browse the repository at this point in the history
  • Loading branch information
doulikecookiedough committed Feb 1, 2024
1 parent 8314dfd commit 72f2824
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ private ObjectMetadata syncPutObject(
);
// Tag object
String cid = objInfo.getCid();
objInfo.setPid(pid);
tagObject(pid, cid);
logFileHashStore.info(
"FileHashStore.syncPutObject - Object stored for pid: " + pid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public void storeObject() throws Exception {
// Check id (content identifier based on the store algorithm)
String objectCid = testData.pidData.get(pid).get("sha256");
assertEquals(objectCid, objInfo.getCid());
assertEquals(pid, objInfo.getPid());
}
}

Expand Down Expand Up @@ -1332,8 +1333,9 @@ public void deleteObject_stringPidAll() throws Exception {
Path testMetaDataFile = testData.getTestFile(pidFormatted + ".xml");
InputStream metadataStream = Files.newInputStream(testMetaDataFile);
String testFormatId = "https://test.arcticdata.io/ns";
String metadataPathString = fileHashStore.storeMetadata(metadataStream, pid,
testFormatId);
String metadataPathString = fileHashStore.storeMetadata(
metadataStream, pid, testFormatId
);
String metadataDefaultPathString = fileHashStore.storeMetadata(metadataStream, pid);
Path objCidAbsPath = fileHashStore.getExpectedPath(pid, "object", null);
Path metadataPath = Paths.get(metadataPathString);
Expand Down

0 comments on commit 72f2824

Please sign in to comment.