Updated to files to fit the Standard.
This commit is contained in:
@@ -29,4 +29,5 @@ public class BatchJobApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(BatchJobApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -46,16 +46,13 @@ public class JobConfiguration {
|
||||
|
||||
@Bean
|
||||
public Job job1() {
|
||||
return this.jobBuilderFactory.get("job1")
|
||||
.start(this.stepBuilderFactory.get("job1step1")
|
||||
.tasklet(new Tasklet() {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
logger.info("Job1 was run");
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
})
|
||||
.build())
|
||||
.build();
|
||||
return this.jobBuilderFactory.get("job1").start(this.stepBuilderFactory.get("job1step1").tasklet(new Tasklet() {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
|
||||
logger.info("Job1 was run");
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
}).build()).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
@@ -37,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@ExtendWith(OutputCaptureExtension.class)
|
||||
public class BatchJobApplicationTests {
|
||||
|
||||
|
||||
@Test
|
||||
public void testBatchJobApp(CapturedOutput capturedOutput) throws Exception {
|
||||
final String JOB_RUN_MESSAGE = " was run";
|
||||
@@ -58,7 +56,6 @@ public class BatchJobApplicationTests {
|
||||
|
||||
assertThat(i).isGreaterThan(0);
|
||||
|
||||
|
||||
String taskTitle = "Demo Batch Job Task";
|
||||
Pattern pattern = Pattern.compile(taskTitle);
|
||||
Matcher matcher = pattern.matcher(output);
|
||||
|
||||
Reference in New Issue
Block a user