ExecutionContextDemotionListener extends StepExecutionListenerSupport implements InitializingBean { @Override public void afterPropertiesSet() throws Exception { Assert.notNull(this.keys, "The 'keys' property must be provided"); Assert.notEmpty(this.keys, "The 'keys' property must not be empty"); }  @Override void beforeStep(StepExecution stepExecution); @Override void afterPropertiesSet(); void setKeys(String[] keys); void setStrict(boolean strict);  }
@Test(expected = IllegalArgumentException.class) public void keysMustBeSet() throws Exception { listener.afterPropertiesSet(); }