Search in sources :

Example 71 with QProfileDto

use of org.sonar.db.qualityprofile.QProfileDto in project sonarqube by SonarSource.

the class RegisterQualityProfilesNotificationTest method notification_does_not_include_inherited_profiles_when_rule_is_added.

@Test
public void notification_does_not_include_inherited_profiles_when_rule_is_added() {
    String language = newLanguageKey();
    RuleDefinitionDto newRule = db.rules().insert(r -> r.setLanguage(language));
    QProfileDto builtInQProfileDto = insertProfile(orgQProfile -> orgQProfile.setIsBuiltIn(true).setLanguage(language));
    QProfileDto childQProfileDto = insertProfile(orgQProfile -> orgQProfile.setIsBuiltIn(false).setLanguage(language).setParentKee(builtInQProfileDto.getKee()));
    addPluginProfile(builtInQProfileDto, newRule);
    builtInQProfileRepositoryRule.initialize();
    underTest.start();
    ArgumentCaptor<Multimap> captor = ArgumentCaptor.forClass(Multimap.class);
    verify(builtInQualityProfilesNotification).onChange(captor.capture(), anyLong(), anyLong());
    Multimap<QProfileName, ActiveRuleChange> updatedProfiles = captor.getValue();
    assertThat(updatedProfiles.keySet()).extracting(QProfileName::getName, QProfileName::getLanguage).containsExactlyInAnyOrder(tuple(builtInQProfileDto.getName(), builtInQProfileDto.getLanguage()));
    assertThat(updatedProfiles.values()).extracting(value -> value.getActiveRule().getRuleUuid(), ActiveRuleChange::getType).containsExactlyInAnyOrder(tuple(newRule.getUuid(), ACTIVATED));
}
Also used : QProfileName(org.sonar.server.qualityprofile.builtin.QProfileName) Arrays(java.util.Arrays) RandomStringUtils.randomAlphanumeric(org.apache.commons.lang.RandomStringUtils.randomAlphanumeric) ActiveRuleIndexer(org.sonar.server.qualityprofile.index.ActiveRuleIndexer) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Random(java.util.Random) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) SecureRandom(java.security.SecureRandom) UPDATED(org.sonar.server.qualityprofile.ActiveRuleChange.Type.UPDATED) Collections.singleton(java.util.Collections.singleton) BuiltInQualityProfilesDefinition(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition) Map(java.util.Map) UuidFactoryFast(org.sonar.core.util.UuidFactoryFast) RandomUtils.nextLong(org.apache.commons.lang.math.RandomUtils.nextLong) RulePriority(org.sonar.api.rules.RulePriority) DbTester(org.sonar.db.DbTester) System2(org.sonar.api.utils.System2) BuiltInQProfileInsertImpl(org.sonar.server.qualityprofile.builtin.BuiltInQProfileInsertImpl) BuiltInQualityProfilesUpdateListener(org.sonar.server.qualityprofile.builtin.BuiltInQualityProfilesUpdateListener) BuiltInQProfileUpdateImpl(org.sonar.server.qualityprofile.builtin.BuiltInQProfileUpdateImpl) QProfileName(org.sonar.server.qualityprofile.builtin.QProfileName) Preconditions.checkState(com.google.common.base.Preconditions.checkState) DbClient(org.sonar.db.DbClient) List(java.util.List) BuiltInQProfileRepositoryRule(org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryRule) MAJOR(org.sonar.api.rules.RulePriority.MAJOR) RuleKey(org.sonar.api.rule.RuleKey) QProfileDto(org.sonar.db.qualityprofile.QProfileDto) ACTIVATED(org.sonar.server.qualityprofile.ActiveRuleChange.Type.ACTIVATED) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ServerRuleFinder(org.sonar.server.rule.ServerRuleFinder) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) RuleDefinitionDto(org.sonar.db.rule.RuleDefinitionDto) RuleActivator(org.sonar.server.qualityprofile.builtin.RuleActivator) DEACTIVATED(org.sonar.server.qualityprofile.ActiveRuleChange.Type.DEACTIVATED) Multimap(com.google.common.collect.Multimap) TypeValidations(org.sonar.server.util.TypeValidations) BuiltInQProfileInsert(org.sonar.server.qualityprofile.builtin.BuiltInQProfileInsert) BuiltInQProfileUpdate(org.sonar.server.qualityprofile.builtin.BuiltInQProfileUpdate) Mockito.verifyZeroInteractions(org.mockito.Mockito.verifyZeroInteractions) ArgumentCaptor(org.mockito.ArgumentCaptor) Severity(org.sonar.api.rule.Severity) RulesProfileDto(org.sonar.db.qualityprofile.RulesProfileDto) BuiltInQProfile(org.sonar.server.qualityprofile.builtin.BuiltInQProfile) MoreCollectors(org.sonar.core.util.stream.MoreCollectors) QualityProfileChangeEventService(org.sonar.server.pushapi.qualityprofile.QualityProfileChangeEventService) UserSessionRule(org.sonar.server.tester.UserSessionRule) ActiveRuleDto(org.sonar.db.qualityprofile.ActiveRuleDto) Assertions.tuple(org.assertj.core.api.Assertions.tuple) BuiltInActiveRule(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.BuiltInActiveRule) DefaultRuleFinder(org.sonar.server.rule.DefaultRuleFinder) LanguageTesting.newLanguage(org.sonar.server.language.LanguageTesting.newLanguage) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) RuleIndex(org.sonar.server.rule.index.RuleIndex) QualityProfileTesting.newRuleProfileDto(org.sonar.db.qualityprofile.QualityProfileTesting.newRuleProfileDto) Mockito.verify(org.mockito.Mockito.verify) Consumer(java.util.function.Consumer) Rule(org.junit.Rule) LogTester(org.sonar.api.utils.log.LogTester) NewBuiltInQualityProfile(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.NewBuiltInQualityProfile) Multimap(com.google.common.collect.Multimap) QProfileDto(org.sonar.db.qualityprofile.QProfileDto) RuleDefinitionDto(org.sonar.db.rule.RuleDefinitionDto) Test(org.junit.Test)

Example 72 with QProfileDto

use of org.sonar.db.qualityprofile.QProfileDto in project sonarqube by SonarSource.

the class RegisterQualityProfilesNotificationTest method notification_does_not_include_inherited_profiles_when_rule_is_deactivated.

@Test
public void notification_does_not_include_inherited_profiles_when_rule_is_deactivated() {
    String language = newLanguageKey();
    RuleDefinitionDto rule = db.rules().insert(r -> r.setLanguage(language).setSeverity(Severity.MINOR));
    QProfileDto builtInQProfileDto = insertProfile(orgQProfile -> orgQProfile.setIsBuiltIn(true).setLanguage(language));
    db.qualityProfiles().activateRule(builtInQProfileDto, rule);
    QProfileDto childQProfileDto = insertProfile(orgQProfile -> orgQProfile.setIsBuiltIn(false).setLanguage(language).setParentKee(builtInQProfileDto.getKee()));
    qProfileRules.activateAndCommit(db.getSession(), childQProfileDto, singleton(RuleActivation.create(rule.getUuid())));
    db.commit();
    addPluginProfile(builtInQProfileDto);
    builtInQProfileRepositoryRule.initialize();
    underTest.start();
    ArgumentCaptor<Multimap> captor = ArgumentCaptor.forClass(Multimap.class);
    verify(builtInQualityProfilesNotification).onChange(captor.capture(), anyLong(), anyLong());
    Multimap<QProfileName, ActiveRuleChange> updatedProfiles = captor.getValue();
    assertThat(updatedProfiles.keySet()).extracting(QProfileName::getName, QProfileName::getLanguage).containsExactlyInAnyOrder(tuple(builtInQProfileDto.getName(), builtInQProfileDto.getLanguage()));
    assertThat(updatedProfiles.values()).extracting(value -> value.getActiveRule().getRuleUuid(), ActiveRuleChange::getType).containsExactlyInAnyOrder(tuple(rule.getUuid(), DEACTIVATED));
}
Also used : QProfileName(org.sonar.server.qualityprofile.builtin.QProfileName) Arrays(java.util.Arrays) RandomStringUtils.randomAlphanumeric(org.apache.commons.lang.RandomStringUtils.randomAlphanumeric) ActiveRuleIndexer(org.sonar.server.qualityprofile.index.ActiveRuleIndexer) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Random(java.util.Random) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) SecureRandom(java.security.SecureRandom) UPDATED(org.sonar.server.qualityprofile.ActiveRuleChange.Type.UPDATED) Collections.singleton(java.util.Collections.singleton) BuiltInQualityProfilesDefinition(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition) Map(java.util.Map) UuidFactoryFast(org.sonar.core.util.UuidFactoryFast) RandomUtils.nextLong(org.apache.commons.lang.math.RandomUtils.nextLong) RulePriority(org.sonar.api.rules.RulePriority) DbTester(org.sonar.db.DbTester) System2(org.sonar.api.utils.System2) BuiltInQProfileInsertImpl(org.sonar.server.qualityprofile.builtin.BuiltInQProfileInsertImpl) BuiltInQualityProfilesUpdateListener(org.sonar.server.qualityprofile.builtin.BuiltInQualityProfilesUpdateListener) BuiltInQProfileUpdateImpl(org.sonar.server.qualityprofile.builtin.BuiltInQProfileUpdateImpl) QProfileName(org.sonar.server.qualityprofile.builtin.QProfileName) Preconditions.checkState(com.google.common.base.Preconditions.checkState) DbClient(org.sonar.db.DbClient) List(java.util.List) BuiltInQProfileRepositoryRule(org.sonar.server.qualityprofile.builtin.BuiltInQProfileRepositoryRule) MAJOR(org.sonar.api.rules.RulePriority.MAJOR) RuleKey(org.sonar.api.rule.RuleKey) QProfileDto(org.sonar.db.qualityprofile.QProfileDto) ACTIVATED(org.sonar.server.qualityprofile.ActiveRuleChange.Type.ACTIVATED) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ServerRuleFinder(org.sonar.server.rule.ServerRuleFinder) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) RuleDefinitionDto(org.sonar.db.rule.RuleDefinitionDto) RuleActivator(org.sonar.server.qualityprofile.builtin.RuleActivator) DEACTIVATED(org.sonar.server.qualityprofile.ActiveRuleChange.Type.DEACTIVATED) Multimap(com.google.common.collect.Multimap) TypeValidations(org.sonar.server.util.TypeValidations) BuiltInQProfileInsert(org.sonar.server.qualityprofile.builtin.BuiltInQProfileInsert) BuiltInQProfileUpdate(org.sonar.server.qualityprofile.builtin.BuiltInQProfileUpdate) Mockito.verifyZeroInteractions(org.mockito.Mockito.verifyZeroInteractions) ArgumentCaptor(org.mockito.ArgumentCaptor) Severity(org.sonar.api.rule.Severity) RulesProfileDto(org.sonar.db.qualityprofile.RulesProfileDto) BuiltInQProfile(org.sonar.server.qualityprofile.builtin.BuiltInQProfile) MoreCollectors(org.sonar.core.util.stream.MoreCollectors) QualityProfileChangeEventService(org.sonar.server.pushapi.qualityprofile.QualityProfileChangeEventService) UserSessionRule(org.sonar.server.tester.UserSessionRule) ActiveRuleDto(org.sonar.db.qualityprofile.ActiveRuleDto) Assertions.tuple(org.assertj.core.api.Assertions.tuple) BuiltInActiveRule(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.BuiltInActiveRule) DefaultRuleFinder(org.sonar.server.rule.DefaultRuleFinder) LanguageTesting.newLanguage(org.sonar.server.language.LanguageTesting.newLanguage) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) RuleIndex(org.sonar.server.rule.index.RuleIndex) QualityProfileTesting.newRuleProfileDto(org.sonar.db.qualityprofile.QualityProfileTesting.newRuleProfileDto) Mockito.verify(org.mockito.Mockito.verify) Consumer(java.util.function.Consumer) Rule(org.junit.Rule) LogTester(org.sonar.api.utils.log.LogTester) NewBuiltInQualityProfile(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.NewBuiltInQualityProfile) Multimap(com.google.common.collect.Multimap) QProfileDto(org.sonar.db.qualityprofile.QProfileDto) RuleDefinitionDto(org.sonar.db.rule.RuleDefinitionDto) Test(org.junit.Test)

Example 73 with QProfileDto

use of org.sonar.db.qualityprofile.QProfileDto in project sonarqube by SonarSource.

the class BuiltInQProfileUpdateImplTest method do_not_load_descendants_if_no_changes.

@Test
public void do_not_load_descendants_if_no_changes() {
    RuleDefinitionDto rule = db.rules().insert(r -> r.setLanguage("xoo"));
    QProfileDto profile = db.qualityProfiles().insert(p -> p.setLanguage(rule.getLanguage()).setIsBuiltIn(true));
    QProfileDto childProfile = createChildProfile(profile);
    BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context();
    NewBuiltInQualityProfile newQp = context.createBuiltInQualityProfile(profile.getName(), profile.getLanguage());
    newQp.activateRule(rule.getRepositoryKey(), rule.getRuleKey());
    newQp.done();
    // first run
    BuiltInQProfile builtIn = builtInProfileRepository.create(context.profile(profile.getLanguage(), profile.getName()), rule);
    List<ActiveRuleChange> changes = underTest.update(db.getSession(), builtIn, RulesProfileDto.from(profile));
    assertThat(changes).hasSize(2).extracting(ActiveRuleChange::getType).containsOnly(ActiveRuleChange.Type.ACTIVATED);
    verify(qualityProfileChangeEventService).distributeRuleChangeEvent(any(), eq(changes), eq(persistedProfile.getLanguage()));
    // second run, without any input changes
    RuleActivator ruleActivatorWithoutDescendants = new RuleActivator(system2, db.getDbClient(), typeValidations, userSession) {

        @Override
        DescendantProfilesSupplier createDescendantProfilesSupplier(DbSession dbSession) {
            return (profiles, ruleIds) -> {
                throw new IllegalStateException("BOOM - descendants should not be loaded");
            };
        }
    };
    changes = new BuiltInQProfileUpdateImpl(db.getDbClient(), ruleActivatorWithoutDescendants, activeRuleIndexer, qualityProfileChangeEventService).update(db.getSession(), builtIn, RulesProfileDto.from(profile));
    assertThat(changes).isEmpty();
    verifyNoMoreInteractions(qualityProfileChangeEventService);
}
Also used : INHERITED(org.sonar.server.qualityprofile.ActiveRuleInheritance.INHERITED) ActiveRuleIndexer(org.sonar.server.qualityprofile.index.ActiveRuleIndexer) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) DbSession(org.sonar.db.DbSession) Collections.singletonList(java.util.Collections.singletonList) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) BuiltInQualityProfilesDefinition(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) ActiveRuleChange(org.sonar.server.qualityprofile.ActiveRuleChange) BLOCKER(org.sonar.api.rules.RulePriority.BLOCKER) RulePriority(org.sonar.api.rules.RulePriority) DbTester(org.sonar.db.DbTester) System2(org.sonar.api.utils.System2) Collection(java.util.Collection) ActiveRuleParamDto(org.sonar.db.qualityprofile.ActiveRuleParamDto) OrgActiveRuleDto(org.sonar.db.qualityprofile.OrgActiveRuleDto) List(java.util.List) MAJOR(org.sonar.api.rules.RulePriority.MAJOR) RuleKey(org.sonar.api.rule.RuleKey) QProfileDto(org.sonar.db.qualityprofile.QProfileDto) Optional(java.util.Optional) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) RuleDefinitionDto(org.sonar.db.rule.RuleDefinitionDto) MINOR(org.sonar.api.rules.RulePriority.MINOR) TypeValidations(org.sonar.server.util.TypeValidations) TestSystem2(org.sonar.api.impl.utils.TestSystem2) Severity(org.sonar.api.rule.Severity) CRITICAL(org.sonar.api.rules.RulePriority.CRITICAL) RulesProfileDto(org.sonar.db.qualityprofile.RulesProfileDto) IntegerTypeValidation(org.sonar.server.util.IntegerTypeValidation) Nullable(javax.annotation.Nullable) Before(org.junit.Before) QualityProfileChangeEventService(org.sonar.server.pushapi.qualityprofile.QualityProfileChangeEventService) UserSessionRule(org.sonar.server.tester.UserSessionRule) Collections.emptyMap(java.util.Collections.emptyMap) Tuple(org.assertj.core.groups.Tuple) ActiveRuleDto(org.sonar.db.qualityprofile.ActiveRuleDto) ActiveRuleKey(org.sonar.db.qualityprofile.ActiveRuleKey) Test(org.junit.Test) QualityProfileTesting.newRuleProfileDto(org.sonar.db.qualityprofile.QualityProfileTesting.newRuleProfileDto) Mockito.verify(org.mockito.Mockito.verify) Rule(org.junit.Rule) RuleParamDto(org.sonar.db.rule.RuleParamDto) NewBuiltInQualityProfile(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.NewBuiltInQualityProfile) Tuple.tuple(org.assertj.core.groups.Tuple.tuple) StringTypeValidation(org.sonar.server.util.StringTypeValidation) ActiveRuleInheritance(org.sonar.server.qualityprofile.ActiveRuleInheritance) ActiveRuleChange(org.sonar.server.qualityprofile.ActiveRuleChange) RuleDefinitionDto(org.sonar.db.rule.RuleDefinitionDto) BuiltInQualityProfilesDefinition(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition) DbSession(org.sonar.db.DbSession) QProfileDto(org.sonar.db.qualityprofile.QProfileDto) NewBuiltInQualityProfile(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.NewBuiltInQualityProfile) Test(org.junit.Test)

Example 74 with QProfileDto

use of org.sonar.db.qualityprofile.QProfileDto in project sonarqube by SonarSource.

the class BuiltInQProfileUpdateImplTest method propagate_activation_to_descendant_profiles.

@Test
public void propagate_activation_to_descendant_profiles() {
    RuleDefinitionDto rule = db.rules().insert(r -> r.setLanguage("xoo"));
    QProfileDto profile = db.qualityProfiles().insert(p -> p.setLanguage(rule.getLanguage()).setIsBuiltIn(true));
    QProfileDto childProfile = createChildProfile(profile);
    QProfileDto grandchildProfile = createChildProfile(childProfile);
    BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context();
    NewBuiltInQualityProfile newQp = context.createBuiltInQualityProfile(profile.getName(), profile.getLanguage());
    newQp.activateRule(rule.getRepositoryKey(), rule.getRuleKey());
    newQp.done();
    BuiltInQProfile builtIn = builtInProfileRepository.create(context.profile(profile.getLanguage(), profile.getName()), rule);
    List<ActiveRuleChange> changes = underTest.update(db.getSession(), builtIn, RulesProfileDto.from(profile));
    assertThat(changes).hasSize(3);
    assertThatRuleIsActivated(profile, rule, changes, rule.getSeverityString(), null, emptyMap());
    assertThatRuleIsActivated(childProfile, rule, changes, rule.getSeverityString(), INHERITED, emptyMap());
    assertThatRuleIsActivated(grandchildProfile, rule, changes, rule.getSeverityString(), INHERITED, emptyMap());
    verify(qualityProfileChangeEventService).distributeRuleChangeEvent(any(), eq(changes), eq(persistedProfile.getLanguage()));
}
Also used : QProfileDto(org.sonar.db.qualityprofile.QProfileDto) ActiveRuleChange(org.sonar.server.qualityprofile.ActiveRuleChange) RuleDefinitionDto(org.sonar.db.rule.RuleDefinitionDto) BuiltInQualityProfilesDefinition(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition) NewBuiltInQualityProfile(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.NewBuiltInQualityProfile) Test(org.junit.Test)

Example 75 with QProfileDto

use of org.sonar.db.qualityprofile.QProfileDto in project sonarqube by SonarSource.

the class BuiltInQProfileUpdateImplTest method propagate_rule_param_update_to_descendant_active_rule_params.

@Test
public void propagate_rule_param_update_to_descendant_active_rule_params() {
    RuleDefinitionDto rule = db.rules().insert(r -> r.setLanguage("xoo").setSeverity(Severity.BLOCKER));
    RuleParamDto ruleParam = db.rules().insertRuleParam(rule, p -> p.setName("min").setDefaultValue("10"));
    QProfileDto parentProfile = db.qualityProfiles().insert(p -> p.setLanguage(rule.getLanguage()).setIsBuiltIn(true));
    ActiveRuleDto parentActiveRuleDto = activateRuleInDb(RulesProfileDto.from(parentProfile), rule, RulePriority.valueOf(Severity.MINOR), null);
    activateRuleParamInDb(parentActiveRuleDto, ruleParam, "20");
    QProfileDto childProfile = createChildProfile(parentProfile);
    ActiveRuleDto childActiveRuleDto = activateRuleInDb(RulesProfileDto.from(childProfile), rule, RulePriority.valueOf(Severity.MINOR), INHERITED);
    activateRuleParamInDb(childActiveRuleDto, ruleParam, "20");
    BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context();
    NewBuiltInQualityProfile newQp = context.createBuiltInQualityProfile(parentProfile.getName(), parentProfile.getLanguage());
    newQp.activateRule(rule.getRepositoryKey(), rule.getRuleKey());
    newQp.done();
    BuiltInQProfile builtIn = builtInProfileRepository.create(context.profile(parentProfile.getLanguage(), parentProfile.getName()), rule);
    List<ActiveRuleChange> changes = underTest.update(db.getSession(), builtIn, RulesProfileDto.from(parentProfile));
    assertThat(changes).hasSize(2);
    assertThatRuleHasParams(db, parentActiveRuleDto, tuple("min", "10"));
    assertThatRuleHasParams(db, childActiveRuleDto, tuple("min", "10"));
    verify(qualityProfileChangeEventService).distributeRuleChangeEvent(any(), eq(changes), eq(persistedProfile.getLanguage()));
}
Also used : QProfileDto(org.sonar.db.qualityprofile.QProfileDto) ActiveRuleChange(org.sonar.server.qualityprofile.ActiveRuleChange) RuleDefinitionDto(org.sonar.db.rule.RuleDefinitionDto) ActiveRuleParamDto(org.sonar.db.qualityprofile.ActiveRuleParamDto) RuleParamDto(org.sonar.db.rule.RuleParamDto) BuiltInQualityProfilesDefinition(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition) NewBuiltInQualityProfile(org.sonar.api.server.profile.BuiltInQualityProfilesDefinition.NewBuiltInQualityProfile) OrgActiveRuleDto(org.sonar.db.qualityprofile.OrgActiveRuleDto) ActiveRuleDto(org.sonar.db.qualityprofile.ActiveRuleDto) Test(org.junit.Test)

Aggregations

QProfileDto (org.sonar.db.qualityprofile.QProfileDto)389 Test (org.junit.Test)329 RuleDefinitionDto (org.sonar.db.rule.RuleDefinitionDto)139 UserDto (org.sonar.db.user.UserDto)72 DbSession (org.sonar.db.DbSession)38 ActiveRuleParamDto (org.sonar.db.qualityprofile.ActiveRuleParamDto)38 ProjectDto (org.sonar.db.project.ProjectDto)36 RuleParamDto (org.sonar.db.rule.RuleParamDto)36 GroupDto (org.sonar.db.user.GroupDto)35 NotFoundException (org.sonar.server.exceptions.NotFoundException)31 ActiveRuleDto (org.sonar.db.qualityprofile.ActiveRuleDto)23 TestRequest (org.sonar.server.ws.TestRequest)23 System2 (org.sonar.api.utils.System2)22 RuleQuery (org.sonar.server.rule.index.RuleQuery)22 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)21 DbTester (org.sonar.db.DbTester)21 BadRequestException (org.sonar.server.exceptions.BadRequestException)20 UserSessionRule (org.sonar.server.tester.UserSessionRule)20 List (java.util.List)19 Rule (org.junit.Rule)19