ScssRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(CheckList.SCSS_REPOSITORY_KEY, ScssLanguage.KEY) .setName(CheckList.SCSS_REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, ScssLanguage.KEY).addRuleClasses(false, CheckList.getScssChecks()); repository.done(); }  @Override void define(Context context);  }
@Test public void test() { ScssRulesDefinition rulesDefinition = new ScssRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); RulesDefinition.Repository repository = context.repository("scss"); assertThat(repository.name()).isEqualTo("SonarQube"); assertThat(repository.language()).isEqualTo("scss"); assertThat(repository.rules()).hasSize(99); RulesDefinition.Rule rule = repository.rule(ScssVariableNamingConventionCheck.class.getAnnotation(Rule.class).key()); assertThat(rule).isNotNull(); assertThat(rule.name()).isEqualTo(ScssVariableNamingConventionCheck.class.getAnnotation(Rule.class).name()); }