public void testWithInterface() throws Exception {
JobListenerWithInterface delegate = new JobListenerWithInterface();
factoryBean.setDelegate(delegate);
JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
JobExecution jobExecution = new JobExecution(11L);
listener.beforeJob(jobExecution);
listener.afterJob(jobExecution);
assertTrue(delegate.beforeJobCalled);
assertTrue(delegate.afterJobCalled);
}