}
@Test
public void testGetWithSomethingAlreadyInParentContext() {
context.setAttribute("foo", "bar");
StepContext context = StepSynchronizationManager.register(new StepExecution("bar", new JobExecution(0L)));
Object value = scope.get("foo", new ObjectFactory<Object>() {
@Override
public Object getObject() throws BeansException {
return "spam";
}
});
assertEquals("spam", value);
assertTrue(context.hasAttribute("foo"));
StepSynchronizationManager.close();
assertEquals("bar", scope.get("foo", null));
}