aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/DefaultDatabase.java6
-rw-r--r--sonar-db/src/test/java/org/sonar/db/DefaultDatabaseTest.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/DefaultDatabase.java b/sonar-db/src/main/java/org/sonar/db/DefaultDatabase.java
index 47db0259f00..cf71253f7f5 100644
--- a/sonar-db/src/main/java/org/sonar/db/DefaultDatabase.java
+++ b/sonar-db/src/main/java/org/sonar/db/DefaultDatabase.java
@@ -162,8 +162,10 @@ public class DefaultDatabase implements Database {
private static void completeDefaultProperties(Properties props) {
completeDefaultProperty(props, DatabaseProperties.PROP_URL, DEFAULT_URL);
- completeDefaultProperty(props, DatabaseProperties.PROP_USER, props.getProperty(DatabaseProperties.PROP_USER_DEPRECATED, DatabaseProperties.PROP_USER_DEFAULT_VALUE));
- completeDefaultProperty(props, DatabaseProperties.PROP_PASSWORD, DatabaseProperties.PROP_PASSWORD_DEFAULT_VALUE);
+
+ if (props.getProperty(DatabaseProperties.PROP_USER_DEPRECATED) != null) {
+ completeDefaultProperty(props, DatabaseProperties.PROP_USER, props.getProperty(DatabaseProperties.PROP_USER_DEPRECATED));
+ }
}
private static void completeDefaultProperty(Properties props, String key, String defaultValue) {
diff --git a/sonar-db/src/test/java/org/sonar/db/DefaultDatabaseTest.java b/sonar-db/src/test/java/org/sonar/db/DefaultDatabaseTest.java
index 8fda6636030..0d0c4ee1ad6 100644
--- a/sonar-db/src/test/java/org/sonar/db/DefaultDatabaseTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/DefaultDatabaseTest.java
@@ -35,8 +35,6 @@ public class DefaultDatabaseTest {
db.initSettings();
Properties props = db.getProperties();
- assertThat(props.getProperty("sonar.jdbc.username")).isEqualTo("sonar");
- assertThat(props.getProperty("sonar.jdbc.password")).isEqualTo("sonar");
assertThat(props.getProperty("sonar.jdbc.url")).isEqualTo("jdbc:h2:tcp://localhost/sonar");
assertThat(props.getProperty("sonar.jdbc.driverClassName")).isEqualTo("org.h2.Driver");
assertThat(db.toString()).isEqualTo("Database[jdbc:h2:tcp://localhost/sonar]");