public void testCannotAddIntroductionAdviceToIntroduceClass() throws Throwable {
TestBean target = new TestBean();
target.setAge(21);
ProxyFactory pc = new ProxyFactory(target);
try {
pc.addAdvisor(0, new DefaultIntroductionAdvisor(new TimestampIntroductionInterceptor(), TestBean.class));
fail("Shouldn't be able to add introduction advice that introduces a class, rather than an interface");
}
catch (IllegalArgumentException ex) {
assertTrue(ex.getMessage().indexOf("interface") > -1);
}