From 4e1e43c49d776dd67531e395c9f660b1a2a66b99 Mon Sep 17 00:00:00 2001 From: elmiomar Date: Fri, 15 Mar 2024 09:46:39 -0400 Subject: [PATCH] change purpose of selectDatasetObjects from INFO to GET --- .../nist/oar/distrib/service/RPACachingService.java | 2 +- .../oar/distrib/service/RPACachingServiceTest.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/gov/nist/oar/distrib/service/RPACachingService.java b/src/main/java/gov/nist/oar/distrib/service/RPACachingService.java index 8f87dc83..14bd206f 100644 --- a/src/main/java/gov/nist/oar/distrib/service/RPACachingService.java +++ b/src/main/java/gov/nist/oar/distrib/service/RPACachingService.java @@ -104,7 +104,7 @@ public Map retrieveMetadata(String randomID) throws CacheManagem logger.debug("Requesting metadata for temporary ID=" + randomID); JSONArray metadata = new JSONArray(); List 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); diff --git a/src/test/java/gov/nist/oar/distrib/service/RPACachingServiceTest.java b/src/test/java/gov/nist/oar/distrib/service/RPACachingServiceTest.java index 52829497..949ab7ed 100644 --- a/src/test/java/gov/nist/oar/distrib/service/RPACachingServiceTest.java +++ b/src/test/java/gov/nist/oar/distrib/service/RPACachingServiceTest.java @@ -116,7 +116,7 @@ public void testRetrieveMetadata_success() throws Exception { List 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"; @@ -192,7 +192,7 @@ public void testRetrieveMetadata_withMissingFilepath() throws Exception { List 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"; @@ -241,7 +241,7 @@ public void testRetrieveMetadata_withOneObjectMissingFilepath() throws Exception List 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); @@ -252,7 +252,7 @@ public void testRetrieveMetadata_WithEmptyMetadataList() throws Exception { String randomID = "randomId123"; List 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); } @@ -292,7 +292,7 @@ public void testRetrieveMetadata_WithMalformedBaseUrl() throws Exception { List 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/";