use of org.motechproject.server.ui.impl.UIFrameworkServiceImpl in project motech by motech.
the class UIFrameworkServiceImplTest method shouldIgnoreNonExistentModules.
@Test
public void shouldIgnoreNonExistentModules() {
UIFrameworkServiceImpl uiFrameworkService = new UIFrameworkServiceImpl();
uiFrameworkService.moduleNeedsAttention("nonexistent", "test msg");
uiFrameworkService.moduleBackToNormal("nonexistent");
}
use of org.motechproject.server.ui.impl.UIFrameworkServiceImpl in project motech by motech.
the class UIFrameworkServiceImplTest method shouldSetAndUnsetAttentionNeededFlag.
@Test
public void shouldSetAndUnsetAttentionNeededFlag() {
UIFrameworkServiceImpl uiFrameworkService = new UIFrameworkServiceImpl();
ModuleRegistrationData testModule = new ModuleRegistrationData("test-module", "http://goo.gl");
uiFrameworkService.registerModule(testModule);
uiFrameworkService.moduleNeedsAttention("test-module", "test msg");
Assert.assertTrue(uiFrameworkService.getModuleData("test-module").isNeedsAttention());
Assert.assertEquals(uiFrameworkService.getModuleData("test-module").getCriticalMessage(), "test msg");
uiFrameworkService.moduleBackToNormal("test-module");
Assert.assertFalse(uiFrameworkService.getModuleData("test-module").isNeedsAttention());
Assert.assertTrue(StringUtils.isBlank(uiFrameworkService.getModuleData("test-module").getCriticalMessage()));
}
use of org.motechproject.server.ui.impl.UIFrameworkServiceImpl in project motech by motech.
the class UIFrameworkServiceImplTest method shouldCheckIfModuleRegistered.
@Test
public void shouldCheckIfModuleRegistered() {
UIFrameworkServiceImpl uiFrameworkService = new UIFrameworkServiceImpl();
ModuleRegistrationData testModule = new ModuleRegistrationData("test-module", "http://goo.gl");
assertFalse(uiFrameworkService.isModuleRegistered("test-module"));
uiFrameworkService.registerModule(testModule);
Assert.assertTrue(uiFrameworkService.isModuleRegistered("test-module"));
}
Aggregations