]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7722 The project name should not be mandatory
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 2 Sep 2016 12:06:49 +0000 (14:06 +0200)
committerDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 2 Sep 2016 12:07:04 +0000 (14:07 +0200)
sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorBuilderTest.java

index 95953da2422250e880f6e0a839f5cf0d6a5b0765..aab2c11c2789abbef471f5409a5e0e6b83ee9999 100644 (file)
@@ -208,7 +208,7 @@ public class ProjectDefinition {
   public String getName() {
     String name = properties.get(CoreProperties.PROJECT_NAME_PROPERTY);
     if (StringUtils.isBlank(name)) {
-      name = "Unnamed - " + getKey();
+      name = getKey();
     }
     return name;
   }
index 9cee607615c5a2586fa5cda1ac9017f79e00beeb..94ddaa4cc40be5c2c0351c158bd9236b4de6913b 100644 (file)
@@ -62,7 +62,7 @@ public class ProjectDefinitionTest {
   public void shouldSupportDefaultName() {
     ProjectDefinition def = ProjectDefinition.create();
     def.setKey("myKey");
-    assertThat(def.getName()).isEqualTo("Unnamed - myKey");
+    assertThat(def.getName()).isEqualTo("myKey");
   }
 
   @Test
index 84ad528f2df21b0943fb64b39696ac529c098091..6f7d8502e17dbb7ff5accb93ecd29448cb18aa8d 100644 (file)
@@ -464,7 +464,7 @@ public class ProjectReactorBuilderTest {
   public void shouldAcceptNoProjectName() {
     ProjectDefinition rootProject = loadProjectDefinition("simple-project-with-missing-project-name");
     assertThat(rootProject.getOriginalName()).isNull();
-    assertThat(rootProject.getName()).isEqualTo("Unnamed - com.foo.project");
+    assertThat(rootProject.getName()).isEqualTo("com.foo.project");
   }
 
   @Test