BATCH-1547: fix logic
This commit is contained in:
@@ -54,11 +54,12 @@ public class ExecutionContextPromotionListener extends StepExecutionListenerSupp
|
||||
if (PatternMatcher.match(statusPattern, exitCode)) {
|
||||
for (String key : keys) {
|
||||
if (stepContext.containsKey(key)) {
|
||||
jobContext.put(key, stepContext.get(key));
|
||||
} else {
|
||||
if (strict) {
|
||||
throw new IllegalArgumentException("The key [" + key
|
||||
+ "] was not found in the Step's ExecutionContext.");
|
||||
}
|
||||
jobContext.put(key, stepContext.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -66,6 +66,7 @@ public class ExecutionContextPromotionListenerTests {
|
||||
@Test
|
||||
public void promoteEntryStatusFound() throws Exception {
|
||||
ExecutionContextPromotionListener listener = new ExecutionContextPromotionListener();
|
||||
listener.setStrict(true);
|
||||
|
||||
JobExecution jobExecution = new JobExecution(1L);
|
||||
StepExecution stepExecution = jobExecution.createStepExecution("step1");
|
||||
|
||||
Reference in New Issue
Block a user