* .
*/
@Test
public final void springEmbeddedCacheManagerFactoryBeanShouldUseMBeanServerLookupClassPropIfExplicitlySet()
throws Exception {
final MBeanServerLookup expectedMBeanServerLookup = new PlatformMBeanServerLookup();
final SpringEmbeddedCacheManagerFactoryBean objectUnderTest = new SpringEmbeddedCacheManagerFactoryBean();
objectUnderTest.setMBeanServerLookupClass(expectedMBeanServerLookup.getClass().getName());
objectUnderTest.afterPropertiesSet();
final SpringEmbeddedCacheManager springEmbeddedCacheManager = objectUnderTest.getObject();
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MBeanServerLookupClass. However, it didn't.",
expectedMBeanServerLookup.getClass().getName(), springEmbeddedCacheManager
.getNativeCacheManager().getCacheManagerConfiguration().globalJmxStatistics().mbeanServerLookup().getClass().getName());
springEmbeddedCacheManager.stop();
}