-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Bug description
The just-deprecated JobLauncherTestUtils throws an NPE at getJobLauncher() in Batch 6 RC2 in unit tests.
Tests using JobLauncherTestUtils fail while tests using the new JobOperatorTestUtils work as expected in RC2.
Environment
Spring Boot 4.0.0 RC2
Spring Batch 6.0.0 RC2
Mandrel/Temurin JDK 25.0.1+8
Steps to reproduce
- Open "batch-rc2" reproducible example and run the tests
./gradlew testto see the failing tests- Stacktrace here:
build/reports/tests/test/index.html
- Stacktrace here:
- Build the project skipping tests
./gradlew build -x testand run the jobs specified in the example section - Optionally, see the "batch5" project to see passing tests using JobLauncherTestUtils on boot 3.5.7 and batch 5.2.4.
Expected behavior
Tests written using the deprecated JobLauncherTestUtils should still work correctly until removal in Batch 7.
Minimal Complete Reproducible example
The "batch6-rc2" project contains the failing tests using JobLauncherTestUtils and passing tests using the new JobOperatorTestUtils.
The "batch5" project has passing tests using JobLauncherTestUtils.
Both projects have the same 2 jobs that be ran via the jar (skip tests in the batch6-rc2 project):
java -jar build/libs/*jar --spring.batch.job.name=HelloJob
java -jar build/libs/*jar --spring.batch.job.name=GoodbyeJob