aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-01-31 16:56:28 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-02-08 13:41:00 +0100
commitaf9cd8be6d2fc9656d73ff3ed6ebd633ad33573d (patch)
tree89231da113815c9c23e9e84e24fe40a2ca32c1e4 /server
parent2db601adc43cecad034b8097644a5a260e65aa61 (diff)
downloadsonarqube-af9cd8be6d2fc9656d73ff3ed6ebd633ad33573d.tar.gz
sonarqube-af9cd8be6d2fc9656d73ff3ed6ebd633ad33573d.zip
SONAR-10313 remove dead interface ActiveRule
it was only used to "host" enum Inheritance which is now at upper level and renamed to ActiveRuleInheritance
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java6
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleInheritance.java (renamed from server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRule.java)20
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java12
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java10
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexer.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/rule/ws/ActiveRuleCompleter.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java12
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleImplTest.java20
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTreeImplTest.java8
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexTest.java4
12 files changed, 45 insertions, 61 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
index 608c6a3da68..b1b55fff3c3 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
@@ -42,7 +42,7 @@ public class ActiveRuleChange {
private final ActiveRuleKey key;
private final int ruleId;
private String severity = null;
- private ActiveRule.Inheritance inheritance = null;
+ private ActiveRuleInheritance inheritance = null;
private final Map<String, String> parameters = new HashMap<>();
public ActiveRuleChange(Type type, ActiveRuleDto activeRule, RuleDefinitionDto ruleDefinition) {
@@ -80,13 +80,13 @@ public class ActiveRuleChange {
return this;
}
- public ActiveRuleChange setInheritance(@Nullable ActiveRule.Inheritance i) {
+ public ActiveRuleChange setInheritance(@Nullable ActiveRuleInheritance i) {
this.inheritance = i;
return this;
}
@CheckForNull
- public ActiveRule.Inheritance getInheritance() {
+ public ActiveRuleInheritance getInheritance() {
return inheritance;
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRule.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleInheritance.java
index c3f26fcee79..2aaebbedd7f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRule.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleInheritance.java
@@ -19,22 +19,6 @@
*/
package org.sonar.server.qualityprofile;
-import org.sonar.db.qualityprofile.ActiveRuleKey;
-
-public interface ActiveRule {
-
- enum Inheritance {
- NONE, OVERRIDES, INHERITED
- }
-
- long createdAt();
-
- long updatedAt();
-
- ActiveRuleKey key();
-
- String severity();
-
- Inheritance inheritance();
-
+public enum ActiveRuleInheritance {
+ NONE, OVERRIDES, INHERITED
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java
index 714890f71fc..7828753d7d4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RegisterQualityProfiles.java
@@ -35,7 +35,7 @@ import org.sonar.db.DbSession;
import org.sonar.db.qualityprofile.RulesProfileDto;
import static java.lang.String.format;
-import static org.sonar.server.qualityprofile.ActiveRule.Inheritance.NONE;
+import static org.sonar.server.qualityprofile.ActiveRuleInheritance.NONE;
/**
* Synchronize Quality profiles during server startup
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java
index 0088bbe3474..1db7b05161c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java
@@ -96,7 +96,7 @@ public class RuleActivator {
change = new ActiveRuleChange(ActiveRuleChange.Type.ACTIVATED, activeRuleKey, rule);
applySeverityAndParamToChange(activation, context, change);
if (context.isCascading() || isSameAsParent(change, context)) {
- change.setInheritance(ActiveRule.Inheritance.INHERITED);
+ change.setInheritance(ActiveRuleInheritance.INHERITED);
}
} else {
// already activated
@@ -107,7 +107,7 @@ public class RuleActivator {
change = new ActiveRuleChange(ActiveRuleChange.Type.UPDATED, activeRuleKey, rule);
if (context.isCascading() && activeRule.get().getInheritance() == null) {
// activate on child, then on parent -> mark child as overriding parent
- change.setInheritance(ActiveRule.Inheritance.OVERRIDES);
+ change.setInheritance(ActiveRuleInheritance.OVERRIDES);
change.setSeverity(activeRule.get().getSeverityString());
for (ActiveRuleParamDto activeParam : activeRule.getParams()) {
change.setParameter(activeParam.getKey(), activeParam.getValue());
@@ -117,7 +117,7 @@ public class RuleActivator {
applySeverityAndParamToChange(activation, context, change);
if (!context.isCascading() && context.getParentActiveRule() != null) {
// override rule which is already declared on parents
- change.setInheritance(isSameAsParent(change, context) ? ActiveRule.Inheritance.INHERITED : ActiveRule.Inheritance.OVERRIDES);
+ change.setInheritance(isSameAsParent(change, context) ? ActiveRuleInheritance.INHERITED : ActiveRuleInheritance.OVERRIDES);
}
}
if (isSame(change, activeRule)) {
@@ -263,7 +263,7 @@ public class RuleActivator {
if (severity != null) {
activeRule.setSeverity(severity);
}
- ActiveRule.Inheritance inheritance = change.getInheritance();
+ ActiveRuleInheritance inheritance = change.getInheritance();
if (inheritance != null) {
activeRule.setInheritance(inheritance.name());
}
@@ -290,7 +290,7 @@ public class RuleActivator {
if (severity != null) {
activeRule.get().setSeverity(severity);
}
- ActiveRule.Inheritance inheritance = change.getInheritance();
+ ActiveRuleInheritance inheritance = change.getInheritance();
if (inheritance != null) {
activeRule.get().setInheritance(inheritance.name());
}
@@ -427,7 +427,7 @@ public class RuleActivator {
}
private static boolean isSame(ActiveRuleChange change, ActiveRuleWrapper activeRule) {
- ActiveRule.Inheritance inheritance = change.getInheritance();
+ ActiveRuleInheritance inheritance = change.getInheritance();
if (inheritance != null && !inheritance.name().equals(activeRule.get().getInheritance())) {
return false;
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java
index 0d1d03f7f15..f8c2fdbb7c1 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java
@@ -23,7 +23,7 @@ import com.google.common.collect.Maps;
import java.util.Map;
import javax.annotation.Nullable;
import org.sonar.server.es.BaseDoc;
-import org.sonar.server.qualityprofile.ActiveRule;
+import org.sonar.server.qualityprofile.ActiveRuleInheritance;
import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
import static org.sonar.server.rule.index.RuleIndexDefinition.FIELD_ACTIVE_RULE_ID;
@@ -85,15 +85,15 @@ public class ActiveRuleDoc extends BaseDoc {
return this;
}
- ActiveRule.Inheritance getInheritance() {
+ ActiveRuleInheritance getInheritance() {
String inheritance = getNullableField(FIELD_ACTIVE_RULE_INHERITANCE);
if (inheritance == null || inheritance.isEmpty() ||
containsIgnoreCase(inheritance, "none")) {
- return ActiveRule.Inheritance.NONE;
+ return ActiveRuleInheritance.NONE;
} else if (containsIgnoreCase(inheritance, "herit")) {
- return ActiveRule.Inheritance.INHERITED;
+ return ActiveRuleInheritance.INHERITED;
} else if (containsIgnoreCase(inheritance, "over")) {
- return ActiveRule.Inheritance.OVERRIDES;
+ return ActiveRuleInheritance.OVERRIDES;
} else {
throw new IllegalStateException("Value \"" + inheritance + "\" is not valid for rule's inheritance");
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexer.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexer.java
index a24afa09b56..3a6d468a6bd 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexer.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexer.java
@@ -46,8 +46,8 @@ import org.sonar.server.es.IndexingListener;
import org.sonar.server.es.IndexingResult;
import org.sonar.server.es.OneToOneResilientIndexingListener;
import org.sonar.server.es.ResilientIndexer;
-import org.sonar.server.qualityprofile.ActiveRule;
import org.sonar.server.qualityprofile.ActiveRuleChange;
+import org.sonar.server.qualityprofile.ActiveRuleInheritance;
import org.sonar.server.rule.index.RuleIndexDefinition;
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
@@ -212,7 +212,7 @@ public class ActiveRuleIndexer implements ResilientIndexer {
.setSeverity(SeverityUtil.getSeverityFromOrdinal(dto.getSeverity()));
// all the fields must be present, even if value is null
String inheritance = dto.getInheritance();
- doc.setInheritance(inheritance == null ? ActiveRule.Inheritance.NONE.name() : inheritance);
+ doc.setInheritance(inheritance == null ? ActiveRuleInheritance.NONE.name() : inheritance);
return new IndexRequest(INDEX_TYPE_ACTIVE_RULE.getIndex(), INDEX_TYPE_ACTIVE_RULE.getType())
.id(doc.getId())
.parent(doc.getParent())
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/ActiveRuleCompleter.java b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/ActiveRuleCompleter.java
index 94e920d152d..84a0f04295d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/ActiveRuleCompleter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/ActiveRuleCompleter.java
@@ -49,7 +49,7 @@ import org.sonar.db.qualityprofile.OrgActiveRuleDto;
import org.sonar.db.qualityprofile.QProfileDto;
import org.sonar.db.rule.RuleDefinitionDto;
import org.sonar.db.rule.RuleDto;
-import org.sonar.server.qualityprofile.ActiveRule;
+import org.sonar.server.qualityprofile.ActiveRuleInheritance;
import org.sonar.server.rule.index.RuleQuery;
import org.sonarqube.ws.Rules;
import org.sonarqube.ws.Rules.SearchResponse;
@@ -164,7 +164,7 @@ public class ActiveRuleCompleter {
Rules.Active.Builder builder = Rules.Active.newBuilder();
builder.setQProfile(activeRule.getProfileUuid());
String inheritance = activeRule.getInheritance();
- builder.setInherit(inheritance != null ? inheritance : ActiveRule.Inheritance.NONE.name());
+ builder.setInherit(inheritance != null ? inheritance : ActiveRuleInheritance.NONE.name());
builder.setSeverity(activeRule.getSeverityString());
builder.setCreatedAt(DateUtils.formatDateTime(activeRule.getCreatedAt()));
Rules.Active.Param.Builder paramBuilder = Rules.Active.Param.newBuilder();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java
index f4ce932c2fd..856ecf74362 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java
@@ -52,7 +52,7 @@ import org.sonar.db.rule.RuleParamDto;
import org.sonar.server.es.Facets;
import org.sonar.server.es.SearchIdResult;
import org.sonar.server.es.SearchOptions;
-import org.sonar.server.qualityprofile.ActiveRule;
+import org.sonar.server.qualityprofile.ActiveRuleInheritance;
import org.sonar.server.rule.index.RuleIndex;
import org.sonar.server.rule.index.RuleIndexDefinition;
import org.sonar.server.rule.index.RuleQuery;
@@ -275,11 +275,11 @@ public class SearchAction implements RulesWsAction {
.createParam(PARAM_INHERITANCE)
.setDescription("Comma-separated list of values of inheritance for a rule within a quality profile. Used only if the parameter '" +
PARAM_ACTIVATION + "' is set.")
- .setPossibleValues(ActiveRule.Inheritance.NONE.name(),
- ActiveRule.Inheritance.INHERITED.name(),
- ActiveRule.Inheritance.OVERRIDES.name())
- .setExampleValue(ActiveRule.Inheritance.INHERITED.name() + "," +
- ActiveRule.Inheritance.OVERRIDES.name());
+ .setPossibleValues(ActiveRuleInheritance.NONE.name(),
+ ActiveRuleInheritance.INHERITED.name(),
+ ActiveRuleInheritance.OVERRIDES.name())
+ .setExampleValue(ActiveRuleInheritance.INHERITED.name() + "," +
+ ActiveRuleInheritance.OVERRIDES.name());
action
.createParam(PARAM_ACTIVE_SEVERITIES)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleImplTest.java
index 2e2e742fef8..d858d86a4e1 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleImplTest.java
@@ -68,7 +68,7 @@ import static org.sonar.api.rule.Severity.CRITICAL;
import static org.sonar.api.rule.Severity.MAJOR;
import static org.sonar.api.rule.Severity.MINOR;
import static org.sonar.db.rule.RuleTesting.newCustomRule;
-import static org.sonar.server.qualityprofile.ActiveRule.Inheritance.INHERITED;
+import static org.sonar.server.qualityprofile.ActiveRuleInheritance.INHERITED;
public class QProfileRuleImplTest {
@@ -490,7 +490,7 @@ public class QProfileRuleImplTest {
assertThatProfileHasNoActiveRules(parentProfile);
assertThatRuleIsUpdated(childProfile, rule, MAJOR, null, of(param.getName(), "foo"));
- assertThatRuleIsUpdated(grandChildProfile, rule, CRITICAL, ActiveRule.Inheritance.OVERRIDES, of(param.getName(), "bar"));
+ assertThatRuleIsUpdated(grandChildProfile, rule, CRITICAL, ActiveRuleInheritance.OVERRIDES, of(param.getName(), "bar"));
assertThat(changes).hasSize(1);
}
@@ -514,7 +514,7 @@ public class QProfileRuleImplTest {
assertThatProfileHasNoActiveRules(parentProfile);
assertThatRuleIsUpdated(childProfile, rule, BLOCKER, null, of(param.getName(), "baz"));
- assertThatRuleIsUpdated(grandChildProfile, rule, CRITICAL, ActiveRule.Inheritance.OVERRIDES, of(param.getName(), "bar"));
+ assertThatRuleIsUpdated(grandChildProfile, rule, CRITICAL, ActiveRuleInheritance.OVERRIDES, of(param.getName(), "bar"));
assertThat(changes).hasSize(1);
}
@@ -538,7 +538,7 @@ public class QProfileRuleImplTest {
assertThatRuleIsUpdated(parentProfile, rule, rule.getSeverityString(), null, of(param.getName(), param.getDefaultValue()));
assertThatRuleIsUpdated(childProfile, rule, rule.getSeverityString(), INHERITED, of(param.getName(), param.getDefaultValue()));
- assertThatRuleIsUpdated(grandChildProfile, rule, CRITICAL, ActiveRule.Inheritance.OVERRIDES, of(param.getName(), "bar"));
+ assertThatRuleIsUpdated(grandChildProfile, rule, CRITICAL, ActiveRuleInheritance.OVERRIDES, of(param.getName(), "bar"));
assertThat(changes).hasSize(2);
}
@@ -556,7 +556,7 @@ public class QProfileRuleImplTest {
List<ActiveRuleChange> changes = activate(parentProfile, parentActivation);
assertThatRuleIsUpdated(parentProfile, rule, CRITICAL, null, of(param.getName(), "bar"));
- assertThatRuleIsUpdated(childProfile, rule, MAJOR, ActiveRule.Inheritance.OVERRIDES, of(param.getName(), "foo"));
+ assertThatRuleIsUpdated(childProfile, rule, MAJOR, ActiveRuleInheritance.OVERRIDES, of(param.getName(), "foo"));
assertThat(changes).hasSize(2);
}
@@ -644,7 +644,7 @@ public class QProfileRuleImplTest {
RuleActivation childActivation = RuleActivation.create(rule.getId(), BLOCKER, null);
changes = activate(childProfile, childActivation);
- assertThatRuleIsUpdated(childProfile, rule, BLOCKER, ActiveRule.Inheritance.OVERRIDES, emptyMap());
+ assertThatRuleIsUpdated(childProfile, rule, BLOCKER, ActiveRuleInheritance.OVERRIDES, emptyMap());
assertThat(changes).hasSize(1);
RuleActivation resetActivation = RuleActivation.createReset(rule.getId());
@@ -670,7 +670,7 @@ public class QProfileRuleImplTest {
RuleActivation childActivation = RuleActivation.create(rule.getId(), BLOCKER, null);
changes = activate(childProfile, childActivation);
- assertThatRuleIsUpdated(childProfile, rule, BLOCKER, ActiveRule.Inheritance.OVERRIDES, emptyMap());
+ assertThatRuleIsUpdated(childProfile, rule, BLOCKER, ActiveRuleInheritance.OVERRIDES, emptyMap());
assertThatRuleIsUpdated(grandChildProfile, rule, BLOCKER, INHERITED, emptyMap());
assertThat(changes).hasSize(2);
@@ -678,7 +678,7 @@ public class QProfileRuleImplTest {
RuleActivation resetActivation = RuleActivation.createReset(rule.getId());
changes = activate(baseProfile, resetActivation);
assertThatRuleIsUpdated(baseProfile, rule, rule.getSeverityString(), null, emptyMap());
- assertThatRuleIsUpdated(childProfile, rule, BLOCKER, ActiveRule.Inheritance.OVERRIDES, emptyMap());
+ assertThatRuleIsUpdated(childProfile, rule, BLOCKER, ActiveRuleInheritance.OVERRIDES, emptyMap());
assertThatRuleIsUpdated(grandChildProfile, rule, BLOCKER, INHERITED, emptyMap());
assertThat(changes).hasSize(1);
@@ -894,7 +894,7 @@ public class QProfileRuleImplTest {
}
private void assertThatRuleIsActivated(QProfileDto profile, RuleDefinitionDto rule, @Nullable List<ActiveRuleChange> changes,
- String expectedSeverity, @Nullable ActiveRule.Inheritance expectedInheritance, Map<String, String> expectedParams) {
+ String expectedSeverity, @Nullable ActiveRuleInheritance expectedInheritance, Map<String, String> expectedParams) {
OrgActiveRuleDto activeRule = db.getDbClient().activeRuleDao().selectByProfile(db.getSession(), profile)
.stream()
.filter(ar -> ar.getRuleKey().equals(rule.getKey()))
@@ -929,7 +929,7 @@ public class QProfileRuleImplTest {
}
private void assertThatRuleIsUpdated(QProfileDto profile, RuleDefinitionDto rule,
- String expectedSeverity, @Nullable ActiveRule.Inheritance expectedInheritance, Map<String, String> expectedParams) {
+ String expectedSeverity, @Nullable ActiveRuleInheritance expectedInheritance, Map<String, String> expectedParams) {
OrgActiveRuleDto activeRule = db.getDbClient().activeRuleDao().selectByProfile(db.getSession(), profile)
.stream()
.filter(ar -> ar.getRuleKey().equals(rule.getKey()))
diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTreeImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTreeImplTest.java
index 3f88ea79906..31b3857b905 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTreeImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTreeImplTest.java
@@ -50,7 +50,7 @@ import static java.util.Collections.emptyMap;
import static java.util.Collections.singleton;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.rule.Severity.BLOCKER;
-import static org.sonar.server.qualityprofile.ActiveRule.Inheritance.INHERITED;
+import static org.sonar.server.qualityprofile.ActiveRuleInheritance.INHERITED;
public class QProfileTreeImplTest {
@@ -167,7 +167,7 @@ public class QProfileTreeImplTest {
RuleActivation activation = RuleActivation.create(rule1.getId(), BLOCKER, null);
changes = activate(profile2, activation);
assertThat(changes).hasSize(1);
- assertThatRuleIsUpdated(profile2, rule1, BLOCKER, ActiveRule.Inheritance.OVERRIDES, emptyMap());
+ assertThatRuleIsUpdated(profile2, rule1, BLOCKER, ActiveRuleInheritance.OVERRIDES, emptyMap());
assertThatRuleIsActivated(profile2, rule2, null, rule2.getSeverityString(), null, emptyMap());
changes = underTest.removeParentAndCommit(db.getSession(), profile2);
@@ -211,7 +211,7 @@ public class QProfileTreeImplTest {
}
private void assertThatRuleIsActivated(QProfileDto profile, RuleDefinitionDto rule, @Nullable List<ActiveRuleChange> changes,
- String expectedSeverity, @Nullable ActiveRule.Inheritance expectedInheritance, Map<String, String> expectedParams) {
+ String expectedSeverity, @Nullable ActiveRuleInheritance expectedInheritance, Map<String, String> expectedParams) {
OrgActiveRuleDto activeRule = db.getDbClient().activeRuleDao().selectByProfile(db.getSession(), profile)
.stream()
.filter(ar -> ar.getRuleKey().equals(rule.getKey()))
@@ -246,7 +246,7 @@ public class QProfileTreeImplTest {
}
private void assertThatRuleIsUpdated(QProfileDto profile, RuleDefinitionDto rule,
- String expectedSeverity, @Nullable ActiveRule.Inheritance expectedInheritance, Map<String, String> expectedParams) {
+ String expectedSeverity, @Nullable ActiveRuleInheritance expectedInheritance, Map<String, String> expectedParams) {
OrgActiveRuleDto activeRule = db.getDbClient().activeRuleDao().selectByProfile(db.getSession(), profile)
.stream()
.filter(ar -> ar.getRuleKey().equals(rule.getKey()))
diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java
index 57f3a7126eb..380eba535bb 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java
@@ -44,8 +44,8 @@ import org.sonar.db.user.UserDto;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.organization.DefaultOrganizationProvider;
import org.sonar.server.organization.TestDefaultOrganizationProvider;
-import org.sonar.server.qualityprofile.ActiveRule;
import org.sonar.server.qualityprofile.ActiveRuleChange;
+import org.sonar.server.qualityprofile.ActiveRuleInheritance;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
@@ -291,7 +291,7 @@ public class ChangelogActionTest {
Map<String, Object> data = ImmutableMap.of(
"ruleId", valueOf(rule1.getId()),
"severity", "MINOR",
- "inheritance", ActiveRule.Inheritance.INHERITED.name(),
+ "inheritance", ActiveRuleInheritance.INHERITED.name(),
"param_foo", "foo_value",
"param_bar", "bar_value");
QProfileChangeDto change = insertChange(profile, ActiveRuleChange.Type.ACTIVATED, "theLogin", data);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexTest.java
index bf9637321c6..602c3f54ca8 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexTest.java
@@ -76,8 +76,8 @@ import static org.sonar.db.rule.RuleTesting.setTags;
import static org.sonar.db.rule.RuleTesting.setTemplateId;
import static org.sonar.db.rule.RuleTesting.setType;
import static org.sonar.db.rule.RuleTesting.setUpdatedAt;
-import static org.sonar.server.qualityprofile.ActiveRule.Inheritance.INHERITED;
-import static org.sonar.server.qualityprofile.ActiveRule.Inheritance.OVERRIDES;
+import static org.sonar.server.qualityprofile.ActiveRuleInheritance.INHERITED;
+import static org.sonar.server.qualityprofile.ActiveRuleInheritance.OVERRIDES;
import static org.sonar.server.rule.index.RuleIndex.FACET_LANGUAGES;
import static org.sonar.server.rule.index.RuleIndex.FACET_REPOSITORIES;
import static org.sonar.server.rule.index.RuleIndex.FACET_TAGS;