spring-projects / spring-projects/spring-batch
SimpleJobLauncher not using jobIncrementer
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
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.
jobLauncherTestUtils.setJob(job);
var result = jobLauncherTestUtils.launchJob();
Assertions.assertThat(result.getJobParameters().getString("year")).isEqualTo(DateTimeFormatter.ofPattern("yyyyMM").format(LocalDateTime.now()));
Assertions.assertThat(result.getStatus()).isEqualTo(BatchStatus.COMPLETED);
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.
jobLauncherTestUtils.setJob(job);
var result = jobLauncherTestUtils.launchJob(job.getJobParametersIncrementer().getNext(jobLauncherTestUtils.getUniqueJobParameters()));
Assertions.assertThat(result.getJobParameters().getString("year")).isEqualTo(DateTimeFormatter.ofPattern("yyyyMM").format(LocalDateTime.now()));
Assertions.assertThat(result.getStatus()).isEqualTo(BatchStatus.COMPLETED);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading SimpleJobLauncher and JobLauncherTestUtils, then reproduce the behavior with the launchJob() snippets in the issue and compare it with the CLI result described there. Done means the test utility produces the expected incremented year parameter and the job completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100