ConfigFacadeEjb implements ConfigFacade { static String normalizeLocaleString(String locale) { locale = locale.trim(); int pos = Math.max(locale.indexOf('-'), locale.indexOf('_')); if (pos < 0) { locale = locale.toLowerCase(); } else { locale = locale.substring(0, pos).toLowerCase(Locale.ENGLISH) + '-' + locale.substring(pos + 1).toUpperCase(Locale.ENGLISH); } return locale; }  @Override String getCountryName(); @Override String getCountryLocale(); @Override String getCountryCode(); @Override boolean isConfiguredCountry(String countryCode); @Override String getEpidPrefix(); @Override GeoLatLon getCountryCenter(); @Override int getMapZoom(); @Override boolean isDevMode(); @Override boolean isCustomBranding(); @Override String getCustomBrandingName(); @Override String getCustomBrandingLogoPath(); @Override boolean isUseLoginSidebar(); @Override String getLoginBackgroundPath(); @Override String getSormasInstanceName(); @Override String getAppUrl(); @Override String getAppLegacyUrl(); @Override String getTempFilesPath(); @Override String getGeneratedFilesPath(); @Override String getCustomFilesPath(); @Override String getRScriptExecutable(); @Override boolean isFeatureAutomaticCaseClassification(); @Override String getEmailSenderAddress(); @Override String getEmailSenderName(); @Override String getSmsSenderName(); @Override String getSmsAuthKey(); @Override String getSmsAuthSecret(); @Override double getNameSimilarityThreshold(); @Override int getInfrastructureSyncThreshold(); @Override char getCsvSeparator(); @Override int getDaysAfterCaseGetsArchived(); @Override int getDaysAfterEventGetsArchived(); @Override String getGeocodingOsgtsEndpoint(); @Override String getSymptomJournalUrl(); @Override String getSymptomJournalAuthUrl(); @Override String getSymptomJournalClientId(); @Override String getSymptomJournalSecret(); @Override SormasToSormasConfig getSormasToSormasConfig(); @Override String getPatientDiaryUrl(); @Override String getSormasToSormasUserPassword(); @Override void validateExternalUrls(); @Override String getAuthenticationProvider(); @Override void validateAppUrls(); static final String COUNTRY_NAME; static final String COUNTRY_LOCALE; static final String COUNTRY_EPID_PREFIX; static final String VERSION_PLACEHOLER; static final String DEV_MODE; static final String CUSTOM_BRANDING; static final String CUSTOM_BRANDING_NAME; static final String CUSTOM_BRANDING_LOGO_PATH; static final String CUSTOM_BRANDING_USE_LOGIN_SIDEBAR; static final String CUSTOM_BRANDING_LOGIN_BACKGROUND_PATH; static final String APP_URL; static final String APP_LEGACY_URL; static final String FEATURE_AUTOMATIC_CASE_CLASSIFICATION; static final String TEMP_FILES_PATH; static final String GENERATED_FILES_PATH; static final String CUSTOM_FILES_PATH; static final String CSV_SEPARATOR; static final String RSCRIPT_EXECUTABLE; static final String EMAIL_SENDER_ADDRESS; static final String EMAIL_SENDER_NAME; static final String SMS_SENDER_NAME; static final String SMS_AUTH_KEY; static final String SMS_AUTH_SECRET; static final String NAME_SIMILARITY_THRESHOLD; static final String INFRASTRUCTURE_SYNC_THRESHOLD; static final String INTERFACE_SYMPTOM_JOURNAL_URL; static final String INTERFACE_SYMPTOM_JOURNAL_AUTH_URL; static final String INTERFACE_SYMPTOM_JOURNAL_CLIENT_ID; static final String INTERFACE_SYMPTOM_JOURNAL_SECRET; static final String INTERFACE_PATIENT_DIARY_URL; static final String DAYS_AFTER_CASE_GETS_ARCHIVED; }
@Test public void testNormalizeLocaleString() { assertThat(ConfigFacadeEjb.normalizeLocaleString(" "), isEmptyString()); assertThat(ConfigFacadeEjb.normalizeLocaleString("en"), is("en")); assertThat(ConfigFacadeEjb.normalizeLocaleString("En"), is("en")); assertThat(ConfigFacadeEjb.normalizeLocaleString("en-CA"), is("en-CA")); assertThat(ConfigFacadeEjb.normalizeLocaleString("en-cA"), is("en-CA")); }