diff options
author | Koushik Dasgupta <koushikd@microsoft.com> | 2015-09-29 13:11:03 +0530 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-09-29 23:34:04 +0200 |
commit | 0c48fce81f4fa6ed32668417e1af1805b84d31ff (patch) | |
tree | e84afaed893c5210f2ceb5c4ce59ea5d6a3cce2c /sonar-db | |
parent | 271e2cde317eeee0b5a07bc74394958dc4f8370d (diff) | |
download | sonarqube-0c48fce81f4fa6ed32668417e1af1805b84d31ff.tar.gz sonarqube-0c48fce81f4fa6ed32668417e1af1805b84d31ff.zip |
SONAR-6863 Support Integrated Authentication for SQL Server with SonarQube installed in Windows
Enabling Integrated Authentication for connecting to MS Sql Server. Default value for sonar.jdbc.username and sonar.jdbc.password have been removed.
Diffstat (limited to 'sonar-db')
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/DefaultDatabase.java | 6 | ||||
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/DefaultDatabaseTest.java | 2 |
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]"); |