Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change purpose of selectDatasetObjects from INFO to GET #108

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public Map<String, Object> retrieveMetadata(String randomID) throws CacheManagem
logger.debug("Requesting metadata for temporary ID=" + randomID);
JSONArray metadata = new JSONArray();
List<CacheObject> objects = this.pdrCacheManager.selectDatasetObjects(randomID,
this.pdrCacheManager.VOL_FOR_INFO);
this.pdrCacheManager.VOL_FOR_GET);
if (objects.size() > 0) {
for (CacheObject obj : objects) {
JSONObject objMd = formatMetadata(obj.exportMetadata(), randomID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void testRetrieveMetadata_success() throws Exception {

List<CacheObject> cacheObjects = Arrays.asList(cacheObject1, cacheObject2);

when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_INFO))
when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_GET))
.thenReturn(cacheObjects);

String testBaseDownloadUrl = "https://testdata.nist.gov";
Expand Down Expand Up @@ -192,7 +192,7 @@ public void testRetrieveMetadata_withMissingFilepath() throws Exception {

List<CacheObject> cacheObjects = Arrays.asList(cacheObject1, cacheObject2);

when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_INFO))
when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_GET))
.thenReturn(cacheObjects);

String testBaseDownloadUrl = "https://testdata.nist.gov";
Expand Down Expand Up @@ -241,7 +241,7 @@ public void testRetrieveMetadata_withOneObjectMissingFilepath() throws Exception

List<CacheObject> cacheObjects = Arrays.asList(cacheObject1);

when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_INFO))
when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_GET))
.thenReturn(cacheObjects);

rpaCachingService.retrieveMetadata(randomID);
Expand All @@ -252,7 +252,7 @@ public void testRetrieveMetadata_WithEmptyMetadataList() throws Exception {

String randomID = "randomId123";
List<CacheObject> objects = new ArrayList<>();
when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_INFO)).thenReturn(objects);
when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_GET)).thenReturn(objects);

rpaCachingService.retrieveMetadata(randomID);
}
Expand Down Expand Up @@ -292,7 +292,7 @@ public void testRetrieveMetadata_WithMalformedBaseUrl() throws Exception {

List<CacheObject> cacheObjects = Arrays.asList(cacheObject1, cacheObject2);

when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_INFO))
when(pdrCacheManager.selectDatasetObjects(randomID, pdrCacheManager.VOL_FOR_GET))
.thenReturn(cacheObjects);

String testBaseDownloadUrl = "htp://testdata.nist.gov/";
Expand Down
Loading