You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description JobScopeTestExecutionListener invokes any method with the JobExecution return type. Consider the following test with uses a utility method to launch a job. The method will be invoked by JobScopeTestExecutionListener before the @BeforeEach and @Test method. In this case causing the test to fail because the jobParameters is null.
I was also quite surprised when I stumbled on this in a similar manner, and I'm not sure whether it's a good idea that the listeners are added with @SpringBatchTest automatically. In particular, since there is no straight-forward way to disable them, if I still want the beans from BatchTestContextCustomizer.
Maybe an annotation like e.g. @TestJobExecution on the method would be a sensible requirement for users to enable this feature.
Bug description
JobScopeTestExecutionListener
invokes any method with theJobExecution
return type. Consider the following test with uses a utility method to launch a job. The method will be invoked byJobScopeTestExecutionListener
before the@BeforeEach
and@Test
method. In this case causing the test to fail because thejobParameters
isnull
.Environment
Spring Batch version: 4.3.3
Java version: 11.0.12
Database: H2 1.4.200
Steps to reproduce
JobScopeTestExecutionListener
, for example by adding@SpringBatchTest
JobExecution
, can have any number of argumentsExpected behavior
org.springframework.batch.test.JobScopeTestExecutionListener#getJobExecution(TestContext)
looks only at fields as the comment says.Minimal Complete Reproducible example
The text was updated successfully, but these errors were encountered: