use of org.sonar.plugins.java.api.CheckRegistrar.RegistrarContext in project JavaForFun by gumartinm.
the class CustomRulesCheckRegistrarTest method whenCreatingCustomJavaCheckRegistrarThenGenerateClassWithSuccess.
@Test
public void whenCreatingCustomJavaCheckRegistrarThenGenerateClassWithSuccess() {
CustomRulesCheckRegistrar registrar = new CustomRulesCheckRegistrar();
RegistrarContext registrarContext = new CheckRegistrar.RegistrarContext();
registrar.register(registrarContext);
List<Class<? extends JavaCheck>> checkClasses = Lists.newArrayList(registrarContext.checkClasses());
List<Class<? extends JavaCheck>> testCheckClasses = Lists.newArrayList(registrarContext.testCheckClasses());
assertThat(checkClasses.size(), is(2));
assertThat(testCheckClasses.size(), is(0));
assertThat(registrarContext.repositoryKey(), is(CheckList.REPOSITORY_KEY));
}
Aggregations