@Override public void beforeStep(StepExecution stepExecution) { try { delegate.beforeStep(); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public void afterJob(JobExecution jobExecution) { try { delegate.afterJob(); } catch (Exception e) { throw new BatchRuntimeException(e); } } }
@Override public void beforeJob(JobExecution jobExecution) { try { delegate.beforeJob(); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public ExitStatus afterStep(StepExecution stepExecution) { try { delegate.afterStep(); } catch (Exception e) { throw new BatchRuntimeException(e); } return stepExecution.getExitStatus(); } }
@Test public void testAfterJob() throws Exception { adapter.afterJob(null); verify(delegate).afterJob(); }
@Test public void testBeforeJob() throws Exception { adapter.beforeJob(null); verify(delegate).beforeJob(); }
@Test public void testBeforeStep() throws Exception { adapter.beforeStep(null); verify(delegate).beforeStep(); }
@Test(expected=BatchRuntimeException.class) public void testAfterStepException() throws Exception { doThrow(new Exception("expected")).when(delegate).afterStep(); adapter.afterStep(null); } }
@Test(expected=BatchRuntimeException.class) public void testAfterJobException() throws Exception { doThrow(new Exception("expected")).when(delegate).afterJob(); adapter.afterJob(null); } }
@Test(expected=BatchRuntimeException.class) public void testBeforeJobException() throws Exception { doThrow(new Exception("expected")).when(delegate).beforeJob(); adapter.beforeJob(null); }
@Test(expected=BatchRuntimeException.class) public void testBeforeStepException() throws Exception { doThrow(new Exception("expected")).when(delegate).beforeStep(); adapter.beforeStep(null); }
@Test public void testAfterStep() throws Exception { ExitStatus exitStatus = new ExitStatus("complete"); when(execution.getExitStatus()).thenReturn(exitStatus); assertEquals(exitStatus, adapter.afterStep(execution)); verify(delegate).afterStep(); }
@Override public void afterJob() { try { this.delegate.afterJob(); } catch (Exception e) { throw new BatchContainerRuntimeException(e); } }
@Override public void beforeJob(JobExecution jobExecution) { try { delegate.beforeJob(); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public void beforeStep(StepExecution stepExecution) { try { delegate.beforeStep(); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@Override public void afterJob() { try { this.delegate.afterJob(); } catch (Exception e) { throw new BatchContainerRuntimeException(e); } }
@Override public void beforeJob() { try { this.delegate.beforeJob(); } catch (Exception e) { throw new BatchContainerRuntimeException(e); } } }
@Override public void afterJob(JobExecution jobExecution) { try { delegate.afterJob(); } catch (Exception e) { throw new BatchRuntimeException(e); } } }
@Override public void beforeJob() { try { this.delegate.beforeJob(); } catch (Exception e) { throw new BatchContainerRuntimeException(e); } } }
@Override public void afterJob() { try { this.delegate.afterJob(); } catch (Exception e) { throw new BatchContainerRuntimeException(e); } }