public void testRegisterProviderLifecycle() {
dsm.startup();
// this tests to see if the lifecycle of a provider is working
String serviceName = "azeckoski.FakeService1";
FakeService1 service = new FakeService1();
assertEquals(0, service.getTriggers());
// now we register it and the init should be called
dsm.registerService(serviceName, service);
assertNotNull(service.getConfigurationService());
assertEquals("init", service.getSomething());
assertEquals(1, service.getTriggers());
// now we do a config change
Map<String, String> properties = new HashMap<String, String>();
properties.put("azeckoski.FakeService1.something", "THING");
dsm.pushConfig(properties);
assertEquals("config:THING", service.getSomething());
assertEquals(2, service.getTriggers());
// now we unregister
dsm.unregisterService(serviceName);
assertEquals("shutdown", service.getSomething());
assertEquals(3, service.getTriggers());
service = null;
properties = null;
}