use of org.revapi.configuration.ConfigurationValidator in project revapi by revapi.
the class ConfigurableElementFilterTest method testInvalidConfig_noFilters.
@Test
public void testInvalidConfig_noFilters() throws Exception {
ConfigurationValidator validator = new ConfigurationValidator();
String json = "[{\"extension\": \"revapi.filter\", \"configuration\" : { }}]";
ValidationResult result = validator.validate(ModelNode.fromJSONString(json), new ConfigurableElementFilter());
Assert.assertFalse(result.isSuccessful());
}
use of org.revapi.configuration.ConfigurationValidator in project revapi by revapi.
the class ConfigurableElementFilterTest method testInvalidConfig_noDefsForFilter.
@Test
public void testInvalidConfig_noDefsForFilter() throws Exception {
ConfigurationValidator validator = new ConfigurationValidator();
String json = "[{\"extension\": \"revapi.filter\", \"configuration\" : { \"elements\" : { \"include\" : [] }}}]";
ValidationResult result = validator.validate(ModelNode.fromJSONString(json), new ConfigurableElementFilter());
Assert.assertFalse(result.isSuccessful());
json = "[{\"extension\": \"revapi.filter\", \"configuration\": { \"elements\" : { \"exclude\" : [] }}}]";
result = validator.validate(ModelNode.fromJSONString(json), new ConfigurableElementFilter());
Assert.assertFalse(result.isSuccessful());
json = "[{\"extension\": \"revapi.filter\", \"configuration\": { \"archives\" : { \"exclude\" : {} }}}]";
result = validator.validate(ModelNode.fromJSONString(json), new ConfigurableElementFilter());
Assert.assertFalse(result.isSuccessful());
}
Aggregations