aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-core
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2020-07-15 09:53:53 +0200
committersonartech <sonartech@sonarsource.com>2020-07-15 20:04:52 +0000
commitb25d2a824beb28fc8a5ae4bd7cb3eb8bd3413319 (patch)
tree7e940ef847aea96ffc3f5665ac0b447fab844f91 /server/sonar-webserver-core
parenta59e6e96ad22300a795b4b6b5122da06b9623922 (diff)
downloadsonarqube-b25d2a824beb28fc8a5ae4bd7cb3eb8bd3413319.tar.gz
sonarqube-b25d2a824beb28fc8a5ae4bd7cb3eb8bd3413319.zip
SONAR-13618 Remove new lines from db migration log
Diffstat (limited to 'server/sonar-webserver-core')
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java9
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java8
2 files changed, 9 insertions, 8 deletions
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java
index edf844e9be6..8060c42036d 100644
--- a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java
+++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java
@@ -23,6 +23,7 @@ import java.util.Optional;
import org.picocontainer.Startable;
import org.sonar.api.config.Configuration;
import org.sonar.api.utils.MessageException;
+import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.process.ProcessProperties;
import org.sonar.server.platform.db.migration.version.DatabaseVersion;
@@ -58,10 +59,10 @@ public class DatabaseServerCompatibility implements Startable {
String msg = "The database must be manually upgraded. Please backup the database and browse /setup. "
+ "For more information: https://docs.sonarqube.org/latest/setup/upgrading";
Loggers.get(DatabaseServerCompatibility.class).warn(msg);
- Loggers.get(STARTUP_LOGGER_NAME).warn('\n'
- + HIGHLIGHTER + '\n'
- + " " + msg
- + '\n' + HIGHLIGHTER);
+ Logger logger = Loggers.get(STARTUP_LOGGER_NAME);
+ logger.warn(HIGHLIGHTER);
+ logger.warn(msg);
+ logger.warn(HIGHLIGHTER);
}
}
}
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java
index 5a1138e3338..dc08f17a70f 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java
@@ -72,13 +72,13 @@ public class DatabaseServerCompatibilityTest {
when(version.getVersion()).thenReturn(Optional.of(DatabaseVersion.MIN_UPGRADE_VERSION));
new DatabaseServerCompatibility(version, settings.asConfig()).start();
- assertThat(logTester.logs()).hasSize(2);
+ assertThat(logTester.logs()).hasSize(4);
assertThat(logTester.logs(LoggerLevel.WARN)).contains(
"The database must be manually upgraded. Please backup the database and browse /setup. "
+ "For more information: https://docs.sonarqube.org/latest/setup/upgrading",
- "\n################################################################################\n" +
- " The database must be manually upgraded. Please backup the database and browse /setup. "
- + "For more information: https://docs.sonarqube.org/latest/setup/upgrading\n" +
+ "################################################################################",
+ "The database must be manually upgraded. Please backup the database and browse /setup. "
+ + "For more information: https://docs.sonarqube.org/latest/setup/upgrading",
"################################################################################");
}