【发布时间】:2021-04-10 14:56:33
【问题描述】:
我正在 junit 中测试 spring 批处理作业。
public void testJob() {
JobExecution jobExecution = jobLauncherTestUtils.launchStep("processFileStep", params2, executionContext);
JobParameters params3 = new JobParameters(setJobParams());
jobLauncherTestUtils.launchStep("downloadResultsFile", params3, executionContext);
Collection<StepExecution> actualStepExecutions = jobExecution.getStepExecutions();
assertThat(actualStepExecutions.size(), is(1));
assertThat(jobExecution.getJobInstance().getJobName(), is("TestJob"));// where is it set to TestJob?
}
我不明白作业名称是如何设置为 TestJob 的。 ?感谢您的宝贵时间。
【问题讨论】:
标签: spring-boot junit spring-batch