Skip to content

Commit bcd585f

Browse files
authored
Fix backward incompatible method signature change in batch2 JobDefinitionStartRequest (#7131)
* Restore the old method definition of setJobDefinitionId(), and alter the new one with a different method name. Call the new method from the unit test. * Remove the return this method and adjust the unit test.
1 parent f563e9c commit bcd585f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
type: fix
3+
issue: 7130
4+
title: "There is an API backward incompatibility issue with the hapi-fhir-storage-batch-2 library that may break some
5+
client applications.
6+
This has been fixed."

hapi-fhir-storage-batch2-test-utilities/src/test/java/ca/uhn/hapi/fhir/batch2/test/inline/InlineJobCoordinatorTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ void testWithStubJobs() {
136136

137137
// Some sort of batch service would trigger this:
138138
final InlineTestJobParams jobParams = new InlineTestJobParams(30);
139-
final JobInstanceStartRequest jobInstanceStartRequest = new JobInstanceStartRequest().setParameters(jobParams).setJobDefinitionId(JOB_DEFINITION_ID);
139+
final JobInstanceStartRequest jobInstanceStartRequest = new JobInstanceStartRequest().setParameters(jobParams);
140+
jobInstanceStartRequest.setJobDefinitionId(JOB_DEFINITION_ID);
140141
// This is the contract for the tests to pass their own job instance ID:
141142
final SystemRequestDetails requestDetails = new SystemRequestDetails();
142143
requestDetails.addHeader(InlineJobCoordinator.JOB_INSTANCE_ID_FOR_TESTING, JOB_INSTANCE_ID);

hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/model/JobInstanceStartRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ public String getJobDefinitionId() {
7070
return myJobDefinitionId;
7171
}
7272

73-
public JobInstanceStartRequest setJobDefinitionId(String theJobDefinitionId) {
73+
public void setJobDefinitionId(String theJobDefinitionId) {
7474
myJobDefinitionId = theJobDefinitionId;
75-
return this;
7675
}
7776

7877
public String getParameters() {

0 commit comments

Comments
 (0)