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
For example, testing a job or a step with this tasklet defined does not work properly if the platform running the test does not have the target command available.
Would it make sense to decouple the Runtime dependency from this tasklet, so that a test can have more control over it? I would propose a pattern similar to the SystemExiter and JvmSystemExiter.
I am happy to submit a proposal in case the idea is accepted.
The text was updated successfully, but these errors were encountered:
Thank you for opening this feature request. This makes sense to me, something like CommandRunner and JvmCommandRunner could indeed decouple the command execution from the tasklet and make it possible to mock/stub the CommandRunner in tests. You are welcome to open a PR for that.
Currently, the
SystemCommandTasklet
is not so test-friendly, mainly due to the usage ofRuntime.getRuntime().exec(...)
:spring-batch/spring-batch-core/src/main/java/org/springframework/batch/core/step/tasklet/SystemCommandTasklet.java
Line 103 in 6b4c916
For example, testing a job or a step with this tasklet defined does not work properly if the platform running the test does not have the target command available.
Would it make sense to decouple the
Runtime
dependency from this tasklet, so that a test can have more control over it? I would propose a pattern similar to the SystemExiter and JvmSystemExiter.I am happy to submit a proposal in case the idea is accepted.
The text was updated successfully, but these errors were encountered: