@Test
public void testOuterContextPreserved() throws Exception {
RepeatTemplate outer = getRepeatTemplate();
outer.setCompletionPolicy(new SimpleCompletionPolicy(2));
RepeatTemplate inner = getRepeatTemplate();
outer.iterate(new NestedRepeatCallback(inner, new RepeatCallback() {
@Override
public RepeatStatus doInIteration(RepeatContext context) throws Exception {
count++;
assertNotNull(context);
assertNotSame("Nested batch should have new session", context, context.getParent());