]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13844 Rename repositories from 'SonarAnalyzer' to 'SonarQube'
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Thu, 3 Sep 2020 14:45:37 +0000 (09:45 -0500)
committersonartech <sonartech@sonarsource.com>
Fri, 18 Sep 2020 20:07:13 +0000 (20:07 +0000)
sonar-plugin-api/src/main/java/org/sonar/api/server/rule/internal/DefaultNewRepository.java
sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java

index e0bcc3df6afa1ee2486d04bd3baba892587f0862..e63a5e795f62ca3ed02777c6b7e4f6966199561d 100644 (file)
@@ -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;
index 342b83c2d0d2f768cb16be95fad23de2cbf7a81d..3c8f2c1cd7cbe9f6272d9ed77eef98c9d649c9b4 100644 (file)
@@ -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");