ConfigFacadeEjb implements ConfigFacade { @Override public void validateExternalUrls() { String piaUrl = getSymptomJournalUrl(); if (StringUtils.isBlank(piaUrl)) { return; } if (!new UrlValidator( new String[] { "http", "https" }).isValid(piaUrl)) { throw new IllegalArgumentException("Property '" + ConfigFacadeEjb.INTERFACE_SYMPTOM_JOURNAL_URL + "' is not a valid URL"); } }  @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 testValidateExternalUrls() { MockProducer.getProperties().setProperty(ConfigFacadeEjb.INTERFACE_SYMPTOM_JOURNAL_URL, "https: getConfigFacade().validateExternalUrls(); MockProducer.getProperties().setProperty(ConfigFacadeEjb.INTERFACE_SYMPTOM_JOURNAL_URL, "http: getConfigFacade().validateExternalUrls(); try { MockProducer.getProperties().setProperty(ConfigFacadeEjb.INTERFACE_SYMPTOM_JOURNAL_URL, "htps: } catch (IllegalArgumentException ignored) { } }