|
|
|
|
@ -189,9 +189,10 @@ class BatchJdbcAutoConfigurationTests {
@@ -189,9 +189,10 @@ class BatchJdbcAutoConfigurationTests {
|
|
|
|
|
.run((context) -> { |
|
|
|
|
assertThat(context).hasSingleBean(JobOperator.class); |
|
|
|
|
context.getBean(JobLauncherApplicationRunner.class).run(); |
|
|
|
|
assertThat(context.getBean(JobRepository.class) |
|
|
|
|
.getLastJobExecution("discreteRegisteredJob", new JobParameters()) |
|
|
|
|
.getStatus()).isEqualTo(BatchStatus.COMPLETED); |
|
|
|
|
JobExecution lastJobExecution = context.getBean(JobRepository.class) |
|
|
|
|
.getLastJobExecution("discreteRegisteredJob", new JobParameters()); |
|
|
|
|
assertThat(lastJobExecution).isNotNull(); |
|
|
|
|
assertThat(lastJobExecution.getStatus()).isEqualTo(BatchStatus.COMPLETED); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -213,8 +214,11 @@ class BatchJdbcAutoConfigurationTests {
@@ -213,8 +214,11 @@ class BatchJdbcAutoConfigurationTests {
|
|
|
|
|
this.contextRunner.withUserConfiguration(MultipleJobConfiguration.class, EmbeddedDataSourceConfiguration.class) |
|
|
|
|
.run((context) -> { |
|
|
|
|
assertThat(context).hasFailed(); |
|
|
|
|
assertThat(context.getStartupFailure().getCause().getMessage()) |
|
|
|
|
.contains("Job name must be specified in case of multiple jobs"); |
|
|
|
|
Throwable startupFailure = context.getStartupFailure(); |
|
|
|
|
assertThat(startupFailure).isNotNull(); |
|
|
|
|
Throwable cause = startupFailure.getCause(); |
|
|
|
|
assertThat(cause).isNotNull(); |
|
|
|
|
assertThat(cause.getMessage()).contains("Job name must be specified in case of multiple jobs"); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -642,7 +646,7 @@ class BatchJdbcAutoConfigurationTests {
@@ -642,7 +646,7 @@ class BatchJdbcAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Step getStep(String stepName) { |
|
|
|
|
return null; |
|
|
|
|
return mock(Step.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -679,7 +683,7 @@ class BatchJdbcAutoConfigurationTests {
@@ -679,7 +683,7 @@ class BatchJdbcAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Step getStep(String stepName) { |
|
|
|
|
return null; |
|
|
|
|
return mock(Step.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -710,7 +714,7 @@ class BatchJdbcAutoConfigurationTests {
@@ -710,7 +714,7 @@ class BatchJdbcAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Step getStep(String stepName) { |
|
|
|
|
return null; |
|
|
|
|
return mock(Step.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -756,7 +760,7 @@ class BatchJdbcAutoConfigurationTests {
@@ -756,7 +760,7 @@ class BatchJdbcAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Step getStep(String stepName) { |
|
|
|
|
return null; |
|
|
|
|
return mock(Step.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|