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 e707e18 commit 4e1e43c
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 @@ -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

0 comments on commit 4e1e43c

Please sign in to comment.