|
3 | 3 | import static org.hamcrest.CoreMatchers.equalTo; |
4 | 4 | import static org.hamcrest.CoreMatchers.instanceOf; |
5 | 5 | import static org.hamcrest.MatcherAssert.assertThat; |
| 6 | +import static org.mockito.Mockito.lenient; |
6 | 7 |
|
| 8 | +import io.github.jpmorganchase.fusion.FusionConfiguration; |
7 | 9 | import io.github.jpmorganchase.fusion.api.exception.APICallException; |
8 | 10 | import io.github.jpmorganchase.fusion.api.response.GetPartResponse; |
9 | 11 | import io.github.jpmorganchase.fusion.api.response.Head; |
@@ -35,6 +37,9 @@ class PartFetcherTest { |
35 | 37 | @Mock |
36 | 38 | FusionTokenProvider credentials; |
37 | 39 |
|
| 40 | + @Mock |
| 41 | + FusionConfiguration configuration; |
| 42 | + |
38 | 43 | DownloadRequest dr; |
39 | 44 |
|
40 | 45 | PartRequest pr; |
@@ -338,9 +343,18 @@ private void givenCallToGetSessionBearerReturns(String token) { |
338 | 343 | } |
339 | 344 |
|
340 | 345 | private void givenPartFetcher() { |
341 | | - testee = PartFetcher.builder().client(client).credentials(credentials).build(); |
| 346 | + // New config behaviour for PartChecker |
| 347 | + lenient().when(configuration.getDigestAlgorithm()).thenReturn("SHA-256"); |
| 348 | + lenient().when(configuration.isSkipCheckSumValidation()).thenReturn(false); |
| 349 | + |
| 350 | + testee = PartFetcher.builder() |
| 351 | + .client(client) |
| 352 | + .credentials(credentials) |
| 353 | + .configuration(configuration) |
| 354 | + .build(); |
342 | 355 | } |
343 | 356 |
|
| 357 | + |
344 | 358 | private void givenDownloadRequest(String catalog, String dataset, String apiPath) { |
345 | 359 | dr = DownloadRequest.builder() |
346 | 360 | .catalog(catalog) |
|
0 commit comments