// ... but the interceptor before() was called:
assertEquals("[1]", calls.toString());
}
public void testAfterInterceptors() throws Exception {
RepeatTemplate template = new RepeatTemplate();
final List<Object> calls = new ArrayList<Object>();
template.setListeners(new RepeatListener[] { new RepeatListenerSupport() {
@Override
public void after(RepeatContext context, RepeatStatus result) {
calls.add("1");
}
}, new RepeatListenerSupport() {
@Override
public void after(RepeatContext context, RepeatStatus result) {
calls.add("2");
}
} });
template.iterate(new RepeatCallback() {
@Override
public RepeatStatus doInIteration(RepeatContext context) throws Exception {
count++;
return RepeatStatus.continueIf(count <= 1);
}