Search in sources :

Example 1 with UIFrameworkServiceImpl

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");
}
Also used : UIFrameworkServiceImpl(org.motechproject.server.ui.impl.UIFrameworkServiceImpl) Test(org.junit.Test)

Example 2 with UIFrameworkServiceImpl

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()));
}
Also used : UIFrameworkServiceImpl(org.motechproject.server.ui.impl.UIFrameworkServiceImpl) ModuleRegistrationData(org.motechproject.osgi.web.ModuleRegistrationData) Test(org.junit.Test)

Example 3 with UIFrameworkServiceImpl

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"));
}
Also used : UIFrameworkServiceImpl(org.motechproject.server.ui.impl.UIFrameworkServiceImpl) ModuleRegistrationData(org.motechproject.osgi.web.ModuleRegistrationData) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 UIFrameworkServiceImpl (org.motechproject.server.ui.impl.UIFrameworkServiceImpl)3 ModuleRegistrationData (org.motechproject.osgi.web.ModuleRegistrationData)2