aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2020-09-03 09:45:37 -0500
committersonartech <sonartech@sonarsource.com>2020-09-18 20:07:13 +0000
commit8cccbf3051fbbbe22f57642cf6a36f5b30f24924 (patch)
tree07bd787b74cea1f37c28f679264ba3845b925d77 /sonar-plugin-api
parent2eab677f103451e7803abfd11e04d8cd407e84fd (diff)
downloadsonarqube-8cccbf3051fbbbe22f57642cf6a36f5b30f24924.tar.gz
sonarqube-8cccbf3051fbbbe22f57642cf6a36f5b30f24924.zip
SONAR-13844 Rename repositories from 'SonarAnalyzer' to 'SonarQube'
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRepository.java4
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java8
2 files changed, 11 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRepository.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRepository.java
index e0bcc3df6af..e63a5e795f6 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRepository.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRepository.java
@@ -69,7 +69,9 @@ public class DefaultNewRepository implements RulesDefinition.NewRepository {
@Override
public DefaultNewRepository setName(@Nullable String s) {
- if (StringUtils.isNotEmpty(s)) {
+ if ("SonarAnalyzer".equals(s)) {
+ this.name = "SonarQube";
+ } else if (StringUtils.isNotEmpty(s)) {
this.name = s;
}
return this;
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java
index 342b83c2d0d..3c8f2c1cd7c 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java
@@ -87,6 +87,14 @@ public class RulesDefinitionTest {
}
@Test
+ public void override_sonaranalyzer_repositories_name() {
+ context.createRepository("k", "java").setName("SonarAnalyzer").done();
+ RulesDefinition.Repository repo = context.repository("k");
+ assertThat(repo).isNotNull();
+ assertThat(repo.name()).isEqualTo("SonarQube");
+ }
+
+ @Test
public void define_rules() {
RulesDefinition.NewRepository newRepo = context.createRepository("findbugs", "java");
newRepo.createRule("NPE")