{
ReloadingDetector detector =
EasyMock.createMock(ReloadingDetector.class);
EasyMock.expect(detector.isReloadingRequired()).andReturn(Boolean.TRUE);
EasyMock.replay(detector);
ReloadingController controller = new ReloadingController(detector);
BasicConfigurationBuilder<Configuration> builder =
new BasicConfigurationBuilder<Configuration>(
PropertiesConfiguration.class);
BuilderEventListenerImpl builderListener =
new BuilderEventListenerImpl();
builder.addEventListener(ConfigurationBuilderEvent.ANY, builderListener);
ReloadingBuilderSupportListener listener =
ReloadingBuilderSupportListener.connect(builder, controller);
assertNotNull("No listener returned", listener);
controller.checkForReloading(null);
builderListener.nextEvent(ConfigurationBuilderEvent.RESET);
builderListener.assertNoMoreEvents();
}