@Test public void nullEndpointUrlInvalid() throws ConfigException, MalformedURLException { try { HodConfig.builder() .apiKey(new ApiKey("my-api-key")) .publicIndexesEnabled(true) .ssoPageGetUrl(new URL("https: .endpointUrl(null) .build() .basicValidate("configSection"); fail("Exception should have been thrown"); } catch(final ConfigException e) { MatcherAssert.assertThat("Exception has the correct message", e.getMessage(), containsString("Both URLs for the SSO page must be provided")); } }
@Override public void basicValidate(final String section) throws ConfigException { if (apiKey == null || StringUtils.isEmpty(apiKey.getApiKey())) { throw new ConfigException(section, "Application API key must be provided"); } if (publicIndexesEnabled == null) { throw new ConfigException(section, "The publicIndexesEnabled option must be specified"); } if (ssoPageGetUrl == null || ssoPagePostUrl == null) { throw new ConfigException(section, "Both URLs for the SSO page must be provided"); } if (endpointUrl == null) { throw new ConfigException(section, "The endpoint URL must be provided"); } }
HodConfig extends SimpleComponent<HodConfig> implements OptionalConfigurationComponent<HodConfig> { @Override public void basicValidate(final String section) throws ConfigException { if (apiKey == null || StringUtils.isEmpty(apiKey.getApiKey())) { throw new ConfigException(section, "Application API key must be provided"); } if (publicIndexesEnabled == null) { throw new ConfigException(section, "The publicIndexesEnabled option must be specified"); } if (ssoPageGetUrl == null || ssoPagePostUrl == null) { throw new ConfigException(section, "Both URLs for the SSO page must be provided"); } if (endpointUrl == null) { throw new ConfigException(section, "The endpoint URL must be provided"); } } }
HodConfig extends SimpleComponent<HodConfig> implements OptionalConfigurationComponent<HodConfig> { @Override public void basicValidate(final String section) throws ConfigException { if (apiKey == null || StringUtils.isEmpty(apiKey.getApiKey())) { throw new ConfigException(section, "Application API key must be provided"); } if (publicIndexesEnabled == null) { throw new ConfigException(section, "The publicIndexesEnabled option must be specified"); } if (ssoPageGetUrl == null || ssoPagePostUrl == null) { throw new ConfigException(section, "Both URLs for the SSO page must be provided"); } if (endpointUrl == null) { throw new ConfigException(section, "The endpoint URL must be provided"); } }  }
HodConfig extends SimpleComponent<HodConfig> implements OptionalConfigurationComponent<HodConfig> { @Override public void basicValidate(final String section) throws ConfigException { if (apiKey == null || StringUtils.isEmpty(apiKey.getApiKey())) { throw new ConfigException(section, "Application API key must be provided"); } if (publicIndexesEnabled == null) { throw new ConfigException(section, "The publicIndexesEnabled option must be specified"); } if (ssoPageGetUrl == null || ssoPagePostUrl == null) { throw new ConfigException(section, "Both URLs for the SSO page must be provided"); } if (endpointUrl == null) { throw new ConfigException(section, "The endpoint URL must be provided"); } }  @Override @JsonIgnore Boolean getEnabled(); @Override void basicValidate(final String section); }
HodConfig extends SimpleComponent<HodConfig> implements OptionalConfigurationComponent<HodConfig> { @Override public void basicValidate(final String section) throws ConfigException { if (apiKey == null || StringUtils.isEmpty(apiKey.getApiKey())) { throw new ConfigException(section, "Application API key must be provided"); } if (publicIndexesEnabled == null) { throw new ConfigException(section, "The publicIndexesEnabled option must be specified"); } if (ssoPageGetUrl == null || ssoPagePostUrl == null) { throw new ConfigException(section, "Both URLs for the SSO page must be provided"); } if (endpointUrl == null) { throw new ConfigException(section, "The endpoint URL must be provided"); } }  @Override @JsonIgnore Boolean getEnabled(); @Override void basicValidate(final String section);  }