Skip to content

Commit

Permalink
change purpose of selectDatasetObjects from INFO to GET
Browse files Browse the repository at this point in the history
  • Loading branch information
elmiomar committed Mar 15, 2024
1 parent 6f984f1 commit 8cc66f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,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 @@ -115,7 +115,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 @@ -188,7 +188,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 @@ -236,7 +236,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 @@ -247,7 +247,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 @@ -287,7 +287,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

0 comments on commit 8cc66f3

Please sign in to comment.