Skip to content

Commit 275e013

Browse files
committed
Test fixes
1 parent f0d0d49 commit 275e013

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/bulkmodify/patch/BulkPatchProviderTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ca.uhn.fhir.batch2.jobs.bulkmodify.patch;
22

33
import ca.uhn.fhir.batch2.api.IJobCoordinator;
4+
import ca.uhn.fhir.batch2.api.IJobPartitionProvider;
45
import ca.uhn.fhir.batch2.jobs.bulkmodify.framework.base.BaseBulkModifyJobParameters;
56
import ca.uhn.fhir.batch2.jobs.bulkmodify.framework.common.BulkModifyResourcesResultsJson;
67
import ca.uhn.fhir.batch2.jobs.bulkmodify.patchrewrite.BulkPatchRewriteJobAppCtx;
@@ -91,6 +92,8 @@ public class BulkPatchProviderTest {
9192
static HttpClientExtension ourHttpClient = new HttpClientExtension();
9293
@Mock
9394
private IJobCoordinator myJobCoordinator;
95+
@Mock
96+
private IJobPartitionProvider myJobPartitionProvider;
9497
@Captor
9598
private ArgumentCaptor<JobInstanceStartRequest> myStartRequestCaptor;
9699

@@ -99,6 +102,7 @@ void beforeEach() {
99102
ourProvider.setContextForUnitTest(ourCtx);
100103
ourProvider.setJobCoordinatorForUnitTest(myJobCoordinator);
101104
ourProvider.setPartitionSettingsForUnitTest(new PartitionSettings());
105+
ourProvider.setJobPartitionProviderForUnitTest(myJobPartitionProvider);
102106
}
103107

104108
@ParameterizedTest
@@ -108,6 +112,7 @@ void testInitiateJob(boolean theDryRun) throws IOException {
108112
Batch2JobStartResponse startResponse = new Batch2JobStartResponse();
109113
startResponse.setInstanceId(MY_INSTANCE_ID);
110114
when(myJobCoordinator.startInstance(any(), any())).thenReturn(startResponse);
115+
when(myJobPartitionProvider.getPartitionedUrls(any(), any())).thenCallRealMethod();
111116

112117
Parameters patch = new Parameters();
113118
patch.setId("PATCH");

hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/bulkmodify/patchrewrite/BulkPatchRewriteProviderTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ca.uhn.fhir.batch2.jobs.bulkmodify.patchrewrite;
22

33
import ca.uhn.fhir.batch2.api.IJobCoordinator;
4+
import ca.uhn.fhir.batch2.api.IJobPartitionProvider;
45
import ca.uhn.fhir.batch2.jobs.bulkmodify.patch.BulkPatchProviderTest;
56
import ca.uhn.fhir.batch2.model.JobInstance;
67
import ca.uhn.fhir.batch2.model.JobInstanceStartRequest;
@@ -63,6 +64,8 @@ class BulkPatchRewriteProviderTest {
6364
static HttpClientExtension ourHttpClient = new HttpClientExtension();
6465
@Mock
6566
private IJobCoordinator myJobCoordinator;
67+
@Mock
68+
private IJobPartitionProvider myJobPartitionProvider;
6669
@Captor
6770
private ArgumentCaptor<JobInstanceStartRequest> myStartRequestCaptor;
6871

@@ -71,6 +74,7 @@ void beforeEach() {
7174
ourProvider.setContextForUnitTest(ourCtx);
7275
ourProvider.setJobCoordinatorForUnitTest(myJobCoordinator);
7376
ourProvider.setPartitionSettingsForUnitTest(new PartitionSettings());
77+
ourProvider.setJobPartitionProviderForUnitTest(myJobPartitionProvider);
7478
}
7579

7680
@Test
@@ -79,6 +83,7 @@ void testInitiateJob() throws IOException {
7983
Batch2JobStartResponse startResponse = new Batch2JobStartResponse();
8084
startResponse.setInstanceId(MY_INSTANCE_ID);
8185
when(myJobCoordinator.startInstance(any(), any())).thenReturn(startResponse);
86+
when(myJobPartitionProvider.getPartitionedUrls(any(), any())).thenCallRealMethod();
8287

8388
Parameters patch = new Parameters();
8489
patch.setId("PATCH");

hapi-fhir-storage-batch2-jobs/src/test/java/ca/uhn/fhir/batch2/jobs/bulkmodify/reindex/ReindexProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void testReindex_withDefaults() {
182182
.execute();
183183

184184
// Verify
185-
String expectedPollUrl = "http://localhost:" + myServerExtension.getPort() + "/$hapi.fhir.bulk-patch-status?_jobId=test-job-id";
185+
String expectedPollUrl = "http://localhost:" + myServerExtension.getPort() + "/$hapi.fhir.reindex-status?_jobId=test-job-id";
186186

187187
String serializedOutput = myCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(response.getOperationOutcome());
188188
ourLog.info(serializedOutput);

0 commit comments

Comments
 (0)