Search in sources :

Example 1 with RuleNameProvider

use of org.sonar.scanner.scan.report.RuleNameProvider in project sonarqube by SonarSource.

the class RuleNameProviderTest method setUp.

@Before
public void setUp() {
    ruleKey = mock(RuleKey.class);
    rule = mock(Rule.class);
    rules = mock(Rules.class);
    provider = new RuleNameProvider(rules);
    when(ruleKey.rule()).thenReturn("ruleKey");
    when(ruleKey.repository()).thenReturn("repoKey");
    when(rule.name()).thenReturn("name");
    when(rule.key()).thenReturn(ruleKey);
    when(rules.find(any(RuleKey.class))).thenReturn(rule);
}
Also used : RuleKey(org.sonar.api.rule.RuleKey) RuleNameProvider(org.sonar.scanner.scan.report.RuleNameProvider) Rule(org.sonar.api.batch.rule.Rule) Rules(org.sonar.api.batch.rule.Rules) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 Rule (org.sonar.api.batch.rule.Rule)1 Rules (org.sonar.api.batch.rule.Rules)1 RuleKey (org.sonar.api.rule.RuleKey)1 RuleNameProvider (org.sonar.scanner.scan.report.RuleNameProvider)1