@Test public void test() { SecretJavaRulesDefinition rulesDefinition = new SecretJavaRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); RulesDefinition.Repository repository = context.repository(SecretJavaRulesDefinition.REPOSITORY_KEY); assertThat(repository.name()).isEqualTo("Oracle Code One Repository"); assertThat(repository.language()).isEqualTo("java"); assertThat(repository.rules()).hasSize(SecretRulesList.getChecks().size()); assertRuleProperties(repository); assertAllRuleParametersHaveDescription(repository); }
@Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Oracle Code One Repository"); List<Class<?>> checks = SecretRulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class<?> ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); }
SecretJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Oracle Code One Repository"); List<Class<?>> checks = SecretRulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class<?> ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); } }
SecretJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Oracle Code One Repository"); List<Class<?>> checks = SecretRulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class<?> ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); }  }
SecretJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Oracle Code One Repository"); List<Class<?>> checks = SecretRulesList.getChecks(); new RulesDefinitionAnnotationLoader().load(repository, Iterables.toArray(checks, Class.class)); for (Class<?> ruleClass : checks) { newRule(ruleClass, repository); } repository.done(); }  @Override void define(Context context); }
SecretJavaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(REPOSITORY_KEY, Java.KEY) .setName("Oracle Code One Repository"); List<Class<?>> checks = SecretRulesList.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; }