@Test
	public void testJobNotDefined() throws InterruptedException, ExecutionException, TimeoutException {
		JobInstance jobInstance = new JobInstance(3l, "masterFoo");
		JobExecution jobExecution = new JobExecution(5l);
		jobExecution.setJobInstance(jobInstance);
		StepExecution stepExecution = new StepExecution("masterFoo", jobExecution, 7l);
		final StepContribution stepContribution = new StepContribution(stepExecution);
		final ChunkContext chunkContext = new ChunkContext(new StepContext(stepExecution));

		FutureTask<RepeatStatus> result = new FutureTask<RepeatStatus>(new Callable<RepeatStatus>() {

			@Override
			public RepeatStatus call() throws Exception {
				return tasklet.execute(stepContribution, chunkContext);
			}
		});

		taskExecutor.execute(result);

		try {
			result.get(5, TimeUnit.SECONDS);
		}
		catch (ExecutionException e) {
			Throwable cause = e.getCause();
			assertEquals(cause.getClass(), NoSuchDefinitionException.class);
			assertEquals(cause.getMessage(), "There is no job definition named 'foo'");
		}
	}
@author Michael Minella
@author Gary Russell
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/batch/tasklet/JobLaunchingTaskletTests.java