Open songmag opened 1 year ago
I'm sorry. In the case of SimpleJobLauncher, it is thought that it does not depend on parameters. So, if modification is needed, it seems that JobLauncherTestUtils needs to be modified. Since 5.0.0, the spring launcher test utility seems to be deprecated. What should I do if I am using version 4.3?
JobLauncherTestUtils
How about this modification in JobLauncherTestUtils?
public JobExecution launchJob() throws Exception {
JobParametersIncrementer incrementer = this.job.getJobParametersIncrementer();
if (incrementer == null) {
return this.launchJob(this.getUniqueJobParameters());
}
return this.launchJob(incrementer.getNext(this.getUniqueJobParameters()));
}
i want same result using that cli run but the test util is using the simple job launcher
Which cli are you referring to? The CommandLineJobRunner
does not use the incrementer unless you specify the -next
option. The equivalent API is JobOperator#startNextInstance
. SimpleJobLauncher
is not designed to start the next instance with the run
method since the user gives the parameters and can increment them beforehand if needed.
So, if modification is needed, it seems that JobLauncherTestUtils needs to be modified. Since 5.0.0, the spring launcher test utility seems to be deprecated.
Which deprecated test utility you are referring to?
Please clarify the bug report. I still don't fully understand the issue your are reporting. Thank you upfront.
Please do a quick search on Github issues first, there might be already a duplicate issue for the one you are about to create. If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:
Bug description A clear and concise description of what the bug is about.
Simple Job Launcher not using JobParametersIncrementer
i want same result using that cli run but the test util is using the simple job launcher
so, i want to change the simpleJobLauncher
Environment Please provide as many details as possible: Spring Batch version, Java version, which database you use if any, etc spring batch 4.3 java 11
Steps to reproduce Steps to reproduce the issue.
Expected behavior A clear and concise description of what you expected to happen.
Minimal Complete Reproducible example Please provide a failing test or a minimal complete verifiable example that reproduces the issue. Bug reports that are reproducible will take priority in resolution over reports that are not reproducible.