public FeatureDisabledException(Feature feature, String configName, String enableConfigKey, String enableConfigValue) { super(String.format("Feature '%s' is not enabled. Please set '%s' to '%s' in the '%s' to enable this feature.", feature.name().toLowerCase(), enableConfigKey, enableConfigValue, configName)); this.feature = feature; this.configName = configName; this.enableConfigKey = enableConfigKey; this.enableConfigValue = enableConfigValue; }
public FeatureDisabledException(Feature feature, String configName, String enableConfigKey, String enableConfigValue) { super(String.format("Feature '%s' is not enabled. Please set '%s' to '%s' in the '%s' to enable this feature.", feature.name().toLowerCase(), enableConfigKey, enableConfigValue, configName)); this.feature = feature; this.configName = configName; this.enableConfigKey = enableConfigKey; this.enableConfigValue = enableConfigValue; }
private void assertDisabled(CConfiguration cConf, FeatureDisabledException.Feature feature) throws IOException { try (AuthorizerInstantiator instantiator = new AuthorizerInstantiator(cConf, AUTH_CONTEXT_FACTORY)) { Authorizer authorizer = instantiator.get(); Assert.assertTrue( String.format("When %s is disabled, a %s must be returned, but got %s.", feature.name().toLowerCase(), NoOpAuthorizer.class.getSimpleName(), authorizer.getClass().getName()), authorizer instanceof NoOpAuthorizer ); } }