@Before public void setUp() throws Exception { handler.setStep(new StepSupport() { @Override public void execute(StepExecution stepExecution) throws JobInterruptedException { count++; stepExecutions.add(stepExecution.getStepName()); } }); handler.afterPropertiesSet(); }
@Test public void testConfiguration() throws Exception { handler = new TaskExecutorPartitionHandler(); try { handler.afterPropertiesSet(); fail("Expected IllegalStateException when no step is set"); } catch (IllegalStateException e) { // expected String message = e.getMessage(); assertEquals("Wrong message: " + message, "A Step must be provided.", message); } }