Dependency dependency = (Dependency) getBean("Dependency");
assertNotNull(dependency);
pojo = (POJO) getBean("Intercepted");
assertNotNull(pojo);
int called = TestAspectWithDependency.called;
pojo.method(2);
assertEquals("Interceptor was not rebound", called + 1, TestAspectWithDependency.called);
assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestAspectWithDependency.invoked);
}
finally
{