Search in sources :

Example 6 with ModuleQProfiles

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

the class QualityProfileProviderTest method testProjectDoesntExist.

@Test
public void testProjectDoesntExist() {
    when(projectRepo.exists()).thenReturn(false);
    when(loader.loadDefault(anyString())).thenReturn(response);
    ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props);
    assertResponse(qps);
    verify(loader).loadDefault(anyString());
    verifyNoMoreInteractions(loader);
}
Also used : ModuleQProfiles(org.sonar.scanner.rule.ModuleQProfiles) Test(org.junit.Test)

Example 7 with ModuleQProfiles

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

the class ActiveRulesProviderTest method mockProfiles.

private static ModuleQProfiles mockProfiles(String... keys) {
    List<QualityProfile> profiles = new LinkedList<>();
    for (String k : keys) {
        QualityProfile p = QualityProfile.newBuilder().setKey(k).setLanguage(k).build();
        profiles.add(p);
    }
    return new ModuleQProfiles(profiles);
}
Also used : QualityProfile(org.sonarqube.ws.QualityProfiles.SearchWsResponse.QualityProfile) LinkedList(java.util.LinkedList) ModuleQProfiles(org.sonar.scanner.rule.ModuleQProfiles)

Aggregations

ModuleQProfiles (org.sonar.scanner.rule.ModuleQProfiles)7 Test (org.junit.Test)5 QualityProfile (org.sonarqube.ws.QualityProfiles.SearchWsResponse.QualityProfile)2 LinkedList (java.util.LinkedList)1 Matchers.anyString (org.mockito.Matchers.anyString)1 ActiveRules (org.sonar.api.batch.rule.ActiveRules)1 Profiler (org.sonar.api.utils.log.Profiler)1 LoadedActiveRule (org.sonar.scanner.rule.LoadedActiveRule)1