@Test public void test() { MyJavaRulesDefinition rulesDefinition = new MyJavaRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); RulesDefinition.Repository repository = context.repository(MyJavaRulesDefinition.REPOSITORY_KEY); assertThat(repository.name()).isEqualTo("Sonar Secrets Java"); assertThat(repository.language()).isEqualTo("java"); assertThat(repository.rules()).hasSize(RulesList.getChecks().size()); assertAllRuleParametersHaveDescription(repository); }
@Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Sonar Secrets Java"); List<Class> checks = RulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); }
MyJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Sonar Secrets Java"); List<Class> checks = RulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); } }
MyJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Sonar Secrets Java"); List<Class> checks = RulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); }  }
MyJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Sonar Secrets Java"); List<Class> checks = RulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); }  @Override void define(Context context); }
MyJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Sonar Secrets Java"); List<Class> checks = RulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); }  @Override void define(Context context); static final String REPOSITORY_KEY; }