Search in sources :

Example 1 with SettingsService

use of com.artezio.arttime.services.SettingsService in project ART-TIME by Artezio.

the class IniWebEnvironmentTest method testGetsettingsService_ifNotNull.

@Test
public void testGetsettingsService_ifNotNull() throws NoSuchFieldException {
    setField(iniWebEnvironment, "settingsService", settingsService);
    SettingsService actual = iniWebEnvironment.getSettingsService();
    assertNotNull(actual);
    assertSame(settingsService, actual);
}
Also used : SettingsService(com.artezio.arttime.services.SettingsService) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 2 with SettingsService

use of com.artezio.arttime.services.SettingsService in project ART-TIME by Artezio.

the class IniWebEnvironmentTest method testGetsettingsService_ifNull.

@Test
public void testGetsettingsService_ifNull() throws NoSuchFieldException {
    setField(iniWebEnvironment, "settingsService", null);
    PowerMock.mockStatic(CDIUtils.class);
    expect(CDIUtils.getBean(SettingsService.class)).andReturn(settingsService);
    PowerMock.replayAll(CDIUtils.class);
    SettingsService actual = iniWebEnvironment.getSettingsService();
    PowerMock.verifyAll();
    assertNotNull(actual);
    assertSame(settingsService, actual);
}
Also used : SettingsService(com.artezio.arttime.services.SettingsService) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 3 with SettingsService

use of com.artezio.arttime.services.SettingsService in project ART-TIME by Artezio.

the class SynchronizerTest method setUp.

@Before
public void setUp() throws NoSuchFieldException {
    synchronizer = new Synchronizer();
    settings = new Settings(new EnumMap<>(Setting.Name.class));
    mockControl = EasyMock.createControl();
    employeeSynchronizer = mockControl.createMock(EmployeeSynchronizerLocal.class);
    teamSynchronizer = mockControl.createMock(TeamSynchronizer.class);
    projectService = mockControl.createMock(ProjectService.class);
    settingsService = mockControl.createMock(SettingsService.class);
    setField(synchronizer, "employeeSynchronizer", employeeSynchronizer);
    setField(synchronizer, "teamSynchronizer", teamSynchronizer);
    setField(synchronizer, "projectService", projectService);
    setField(synchronizer, "settingsService", settingsService);
    setField(synchronizer, "settings", settings);
}
Also used : Setting(com.artezio.arttime.config.Setting) ProjectService(com.artezio.arttime.services.ProjectService) SettingsService(com.artezio.arttime.services.SettingsService) EnumMap(java.util.EnumMap) Settings(com.artezio.arttime.config.Settings) Before(org.junit.Before)

Aggregations

SettingsService (com.artezio.arttime.services.SettingsService)3 Test (org.junit.Test)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 Setting (com.artezio.arttime.config.Setting)1 Settings (com.artezio.arttime.config.Settings)1 ProjectService (com.artezio.arttime.services.ProjectService)1 EnumMap (java.util.EnumMap)1 Before (org.junit.Before)1