use of org.motechproject.config.domain.MotechSettings in project motech by motech.
the class ConfigurationServiceBundleIT method shouldGetProperlyPlatformSettings.
@Test
public void shouldGetProperlyPlatformSettings() {
prepareDbSettingsRecord();
MotechSettings settingsRecord = configurationService.getPlatformSettings();
assertEquals(SERVER_URL_TEST, settingsRecord.getServerUrl());
assertEquals(Integer.valueOf(80), settingsRecord.getSessionTimeout());
assertEquals(true, settingsRecord.getEmailRequired());
}
use of org.motechproject.config.domain.MotechSettings in project motech by motech.
the class StartupControllerTest method testSubmitFormOpenId.
@Test
public void testSubmitFormOpenId() throws IOException {
StartupForm startupForm = startupForm();
startupForm.setProviderUrl("https://www.example.com/accounts/id");
startupForm.setLoginMode(LoginMode.OPEN_ID.getName());
when(startupManager.getDefaultSettings()).thenReturn(motechSettings);
when(configurationService.getPlatformSettings()).thenReturn(motechSettings);
List<String> result = startupController.submitForm(startupForm);
assertTrue(result.isEmpty());
verify(configurationService).savePlatformSettings(any(MotechSettings.class));
verify(startupManager).startup();
verify(userService, never()).registerMotechAdmin(anyString(), anyString(), anyString(), any(Locale.class));
}
use of org.motechproject.config.domain.MotechSettings in project motech by motech.
the class StartupControllerTest method testSubmitFormStart.
@Test
public void testSubmitFormStart() throws IOException {
StartupForm startupForm = startupForm();
startupForm.setLoginMode(LoginMode.REPOSITORY.getName());
when(startupManager.getDefaultSettings()).thenReturn(motechSettings);
when(configurationService.getPlatformSettings()).thenReturn(motechSettings);
List<String> result = startupController.submitForm(startupForm);
assertTrue(result.isEmpty());
verify(configurationService).savePlatformSettings(any(MotechSettings.class));
verify(startupManager).startup();
verifyUserRegistration();
}
use of org.motechproject.config.domain.MotechSettings in project motech by motech.
the class SettingServiceImpl method getNumberOfDaysForReminder.
@Override
public int getNumberOfDaysForReminder() {
MotechSettings motechSettings = configurationService.getPlatformSettings();
Integer days = motechSettings.getNumberOfDaysForReminder();
return days == null ? 0 : days;
}
use of org.motechproject.config.domain.MotechSettings in project motech by motech.
the class SettingServiceImpl method getNumberOfDaysToChangePassword.
@Override
public int getNumberOfDaysToChangePassword() {
MotechSettings motechSettings = configurationService.getPlatformSettings();
Integer days = motechSettings.getNumberOfDaysToChangePassword();
return days == null ? 0 : days;
}
Aggregations