concept JobLauncherTestUtils in category spring

This is an excerpt from Manning's book Spring Batch in Action.
We finish this chapter with The Big One: testing an entire job—an easy task with all that we’ve learned. With the help of the Spring TestContext framework and the JobLauncherTestUtils class, it takes only a few lines of code to do the job, as demonstrated in the following listing.
The JobLauncherTestUtils class is another class from the Spring Batch Test module to help you test a single Step or Job. The JobLauncherTestUtils class automatically injects a job by type from the application context; this implies that there’s only one batch job in your test application context. This is a best practice. With JobLauncherTestUtils, you can launch a single step of a job by specifying the step name. You can also specify job parameters. The following snippet shows how to launch only one step: