use of org.revapi.java.spi.CheckBase in project revapi by revapi.
the class CheckSpecificConfigurationTest method testCheckConfigurationInSchema.
@Test
public void testCheckConfigurationInSchema() throws Exception {
class FakeCheck extends CheckBase {
@Override
public EnumSet<Type> getInterest() {
return null;
}
@Nullable
@Override
public String getExtensionId() {
return "testCheck";
}
@Nullable
@Override
public Reader getJSONSchema() {
return new StringReader("{\"type\": \"boolean\"}");
}
}
JavaApiAnalyzer analyzer = new JavaApiAnalyzer(Collections.singleton(new FakeCheck()));
try (Reader rdr = analyzer.getJSONSchema()) {
ModelNode schema = ModelNode.fromJSONString(slurp(rdr));
Assert.assertTrue("boolean".equals(schema.get("properties", "checks", "properties", "testCheck", "type").asString()));
}
}
Aggregations