Skip to content

Improve testability of SystemCommandTasklet #3955

Closed
@scordio

Description

@scordio

Currently, the SystemCommandTasklet is not so test-friendly, mainly due to the usage of Runtime.getRuntime().exec(...):

Process process = Runtime.getRuntime().exec(command, environmentParams, workingDirectory);

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions