From 3b0ae6121fe5671ed584fea72bd3a65c77296cb5 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 19 May 2016 15:46:59 +0200 Subject: [PATCH] Add missing test to LogServerIdTest --- .../org/sonar/server/startup/LogServerIdTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/LogServerIdTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/LogServerIdTest.java index 34c10422c93..7b3206e852f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/startup/LogServerIdTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/startup/LogServerIdTest.java @@ -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) { -- 2.39.5