@Test public void test() { MyCustomScssRulesDefinition rulesDefinition = new MyCustomScssRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); RulesDefinition.Repository repository = context.repository(REPOSITORY_KEY); assertThat(repository.name()).isEqualTo(REPOSITORY_NAME); assertThat(repository.language()).isEqualTo("scss"); assertThat(repository.rules()).hasSize(1); RulesDefinition.Rule customRule = repository.rule(RULE_KEY); assertThat(customRule).isNotNull(); assertThat(customRule.key()).isEqualTo(RULE_KEY); assertThat(customRule.name()).isEqualTo(RULE_NAME); RulesDefinition.Param param = repository.rules().get(0).params().get(0); assertThat(param.key()).isEqualTo("customParam"); assertThat(param.description()).isEqualTo("Custom parameter"); assertThat(param.defaultValue()).isEqualTo("Default value"); }
@Override public void define(Context context) { NewRepository repo = context.createRepository(repositoryKey(), "scss").setName(repositoryName()); new AnnotationBasedRulesDefinition(repo, "scss").addRuleClasses(false, ImmutableList.copyOf(checkClasses())); repo.done(); }
CustomScssRulesDefinition implements CustomRulesDefinition { @Override public void define(Context context) { NewRepository repo = context.createRepository(repositoryKey(), "scss").setName(repositoryName()); new AnnotationBasedRulesDefinition(repo, "scss").addRuleClasses(false, ImmutableList.copyOf(checkClasses())); repo.done(); } }
CustomScssRulesDefinition implements CustomRulesDefinition { @Override public void define(Context context) { NewRepository repo = context.createRepository(repositoryKey(), "scss").setName(repositoryName()); new AnnotationBasedRulesDefinition(repo, "scss").addRuleClasses(false, ImmutableList.copyOf(checkClasses())); repo.done(); }  }
CustomScssRulesDefinition implements CustomRulesDefinition { @Override public void define(Context context) { NewRepository repo = context.createRepository(repositoryKey(), "scss").setName(repositoryName()); new AnnotationBasedRulesDefinition(repo, "scss").addRuleClasses(false, ImmutableList.copyOf(checkClasses())); repo.done(); }  @Override void define(Context context); }
CustomScssRulesDefinition implements CustomRulesDefinition { @Override public void define(Context context) { NewRepository repo = context.createRepository(repositoryKey(), "scss").setName(repositoryName()); new AnnotationBasedRulesDefinition(repo, "scss").addRuleClasses(false, ImmutableList.copyOf(checkClasses())); repo.done(); }  @Override void define(Context context);  }