如何在 spring 批处理 junit 中分配作业名称
How is job name getting assigned in spring batch junit
我正在 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。 ?谢谢你的时间。
我正在 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。 ?谢谢你的时间。