public class JobLaunchingGatewayTests {
@Test
public void testExceptionRaised() throws Exception {
final Message<JobLaunchRequest> message = MessageBuilder.withPayload(new JobLaunchRequest(new JobSupport("testJob"),
new JobParameters())).build();
final JobLauncher jobLauncher = mock(JobLauncher.class);
when(jobLauncher.run(any(Job.class), any(JobParameters.class)))
.thenThrow(new JobParametersInvalidException("This is a JobExecutionException."));