From: Duarte Meneses Date: Thu, 3 Sep 2020 14:45:37 +0000 (-0500) Subject: SONAR-13844 Rename repositories from 'SonarAnalyzer' to 'SonarQube' X-Git-Tag: 8.5.0.37579~59 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8cccbf3051fbbbe22f57642cf6a36f5b30f24924;p=sonarqube.git SONAR-13844 Rename repositories from 'SonarAnalyzer' to 'SonarQube' --- 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 @@ -86,6 +86,14 @@ public class RulesDefinitionTest { assertThat(findbugs.hashCode()).isEqualTo(findbugs.hashCode()); } + @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");