]> source.dussan.org Git - sonarqube.git/commitdiff
Add missing test to LogServerIdTest
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 19 May 2016 13:46:59 +0000 (15:46 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 19 May 2016 13:46:59 +0000 (15:46 +0200)
server/sonar-server/src/test/java/org/sonar/server/startup/LogServerIdTest.java

index 34c10422c9330dd483778006d7b8ff821727cebd..7b3206e852f3df1de95b12ff4bdf762dc5d255ce 100644 (file)
@@ -99,6 +99,17 @@ public class LogServerIdTest {
     verifyLog("\"123456789\"", "-", "-");
   }
 
+  @Test
+  public void log_partial_information_if_property_is_set_without_value() {
+    setProperty(CoreProperties.PERMANENT_SERVER_ID, "123456789");
+    PropertyDto dto = new PropertyDto().setKey(CoreProperties.ORGANISATION).setValue(null);
+    when(dbClient.propertiesDao().selectGlobalProperty(any(DbSession.class), eq(CoreProperties.ORGANISATION))).thenReturn(dto);
+
+    underTest.start();
+
+    verifyLog("\"123456789\"", "-", "-");
+  }
+
   private void setProperty(String propertyKey, @Nullable String propertyValue) {
     PropertyDto dto = null;
     if (propertyValue != null) {