assertEquals(UserLdapProvider.class, userLdapService.getProvider().getClass());
}
public void testOverride() {
ApplicationContext factory = new ClassPathXmlApplicationContext("/context-config.xml");
// userService
UserService userService = (UserService) factory.getBean("userService");
assertNotNull(userService);
// unmerged map
assertNotNull(userService.getSomeMap());
assertEquals(1, userService.getSomeMap().size());
assertEquals(userService.getSomeMap().get("string"), "override string");
// merged list
assertEquals(userService.getSomeList().size(), 3);
// change class
UserLdapProvider ldapProvider = (UserLdapProvider) factory.getBean("userLdapProvider");
assertTrue(ldapProvider instanceof AdvancedUserLdapProvider);
UserService userLdapService = (UserService) factory.getBean("userLdapService");
assertNotNull(userLdapService);
assertEquals(AdvancedUserLdapProvider.class, userLdapService.getProvider().getClass());
}