Test step inside flow #4518
-
Hi. I have a configuration like this: job -> step (outerStep) -> flow (outerFlow) -> flow (innerFlow) -> step (innerStep). I want to run a integration test of the innerStep, but I get a "java.lang.IllegalStateException: No Step found with name: [innerStep]". If I run the test pointing to outerStep it works. My test class is annotated with @SpringBootTest and @SpringBatchTest. How can I call only the innerStep? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It seems the step is not registered correctly. You should be able to test each step separately without any issue. If you provide an entire test, I will try to debug the case and help you efficiently. |
Beta Was this translation helpful? Give feedback.
Thank you for the sample. This seems like a bug in Spring Batch to me. The
JobLauncherTestUtils
should be able to locate the step and run it in isolation no matter how deep it is in the execution graph (ie no matter how many flows are in between the outer step and the inner step). Flows are just "logical" artifacts that connect steps together.I will turn this discussion into an issue.