factoryBean.afterPropertiesSet();
Advised advised = (Advised) factoryBean.getProxy();
Advisor[] advisors = advised.getAdvisors();
assertEquals(2, advisors.length);
Advisor advisor1 = advisors[0];
Advisor advisor2 = advisors[1];
if (advisor1 instanceof CachingModelSourceAdvisor) {
assertEquals(FlushingModelSourceAdvisor.class, advisor2.getClass());
} else if (advisor1 instanceof FlushingModelSourceAdvisor) {
assertEquals(CachingModelSourceAdvisor.class, advisor2.getClass());
} else {
fail("Expected: <" + CachingModelSourceAdvisor.class.getName() + "> or <"
+ FlushingModelSourceAdvisor.class.getName() + "> but was: <"
+ advisor1.getClass().getName() + ">");