Search in sources :

Example 1 with RulesLoader

use of org.sonar.scanner.rule.RulesLoader in project sonarqube by SonarSource.

the class RulesProviderTest method testRuleTranslation.

@Test
public void testRuleTranslation() {
    RulesLoader loader = mock(RulesLoader.class);
    when(loader.load()).thenReturn(Lists.newArrayList(getTestRule()));
    RulesProvider provider = new RulesProvider();
    Rules rules = provider.provide(loader);
    assertThat(rules.findAll()).hasSize(1);
    assertRule(rules.findAll().iterator().next());
}
Also used : RulesProvider(org.sonar.scanner.rule.RulesProvider) RulesLoader(org.sonar.scanner.rule.RulesLoader) Rules(org.sonar.api.batch.rule.Rules) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Rules (org.sonar.api.batch.rule.Rules)1 RulesLoader (org.sonar.scanner.rule.RulesLoader)1 RulesProvider (org.sonar.scanner.rule.RulesProvider)1