DerivedTestBean bean = (DerivedTestBean) this.beanFactory.getBean(name);
assertEquals(session.getAttribute(name), bean);
assertSame(bean, this.beanFactory.getBean(name));
requestAttributes.requestCompleted();
session.invalidate();
assertTrue(bean.wasDestroyed());
}
finally {
RequestContextHolder.setRequestAttributes(null);
}