Skip to content

Commit 0bb9b16

Browse files
committed
Skip checksum validation for multifile downloads where no checksum is provided
1 parent a2faf56 commit 0bb9b16

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/test/java/io/github/jpmorganchase/fusion/FusionTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,19 +255,22 @@ public void testFileDownloadInteraction() throws Exception {
255255
public void testFileDownloadWithSkipsChecksumValidationWhenMissing() throws Exception {
256256
Fusion f = stubFusion();
257257

258-
String datasetJson = "{\"resources\": []}";
258+
// Mock dataset response for checksum validation check
259+
String datasetJsonRaw = "{\"identifier\":\"sample_dataset\",\"deliveryChannel\":[\"glue\"]}";
259260
Dataset glueDataset = Dataset.builder()
260261
.identifier("sample_dataset")
261-
.varArg("deliveryChannel", Arrays.asList("Glue"))
262+
.varArg("deliveryChannel", Arrays.asList("glue"))
262263
.build();
263264
Map<String, Dataset> datasets = new HashMap<>();
264265
datasets.put("sample_dataset", glueDataset);
265266

266267
when(apiManager.callAPI(
267268
String.format("%scatalogs/%s/datasets/%s", config.getRootURL(), "common", "sample_dataset")))
268-
.thenReturn(datasetJson);
269-
when(responseParser.parseDatasetResponse(datasetJson, "common")).thenReturn(datasets);
269+
.thenReturn(datasetJsonRaw);
270+
when(responseParser.parseDatasetResponse(String.format("{\"resources\":[%s]}", datasetJsonRaw), "common"))
271+
.thenReturn(datasets);
270272

273+
// Mock distribution files response
271274
String jsonResponse = "{\"resources\": [{\"identifier\": \"file1\"}]}";
272275
Map<String, DistributionFile> stubResponse = new LinkedHashMap<>();
273276
stubResponse.put(

0 commit comments

Comments
 (0)