public void testWithinJob() throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/org/springframework/data/hadoop/fs/HdfsItemWriterTest-context.xml");
JobLauncher launcher = context.getBean(JobLauncher.class);
Job job = context.getBean(Job.class);
JobParameters jobParameters = new JobParametersBuilder().toJobParameters();
JobExecution execution = launcher.run(job, jobParameters);
assertTrue("status was: " + execution.getStatus(), execution.getStatus() == BatchStatus.COMPLETED);
context.close();
}