use of org.motechproject.server.web.form.StartupSuggestionsForm in project motech by motech.
the class StartupControllerTest method testStartup.
@Test
public void testStartup() {
Properties properties = new Properties();
properties.put("host", "localhost");
properties.put("port", "12345");
NavigableMap<String, String> map = new TreeMap<>();
when(startupManager.canLaunchBundles()).thenReturn(false);
when(startupManager.getDefaultSettings()).thenReturn(motechSettings);
when(localeService.getUserLocale(httpServletRequest)).thenReturn(new Locale("en"));
when(localeService.getSupportedLanguages()).thenReturn(map);
when(configurationService.getPlatformSettings()).thenReturn(motechSettings);
StartupViewData result = startupController.getStartupViewData(httpServletRequest);
verify(startupManager).canLaunchBundles();
verify(localeService).getSupportedLanguages();
verify(localeService).getUserLocale(httpServletRequest);
assertThat(result.getRedirectHome(), Is.is(false));
StartupSuggestionsForm startupSuggestionsForm = result.getSuggestions();
assertTrue(startupSuggestionsForm.getDatabaseUrls().isEmpty());
assertTrue(startupSuggestionsForm.getQueueUrls().isEmpty());
assertTrue(startupSuggestionsForm.getSchedulerUrls().isEmpty());
StartupForm startupSettings = result.getStartupSettings();
Boolean requiresConfigFiles = result.getRequireConfigFiles();
Assert.assertFalse(requiresConfigFiles);
assertEquals("en", startupSettings.getLanguage());
}
Aggregations