You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java
+8-10Lines changed: 8 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -322,13 +322,12 @@ public void setUsername(String username) {
322
322
* @since 1.4.0
323
323
*/
324
324
publicStringdetermineUsername() {
325
-
if (StringUtils.hasText(this.username)) {
326
-
returnthis.username;
327
-
}
328
-
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
325
+
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName()) && !StringUtils.hasText(determineUrl())) {
329
326
return"sa";
330
327
}
331
-
returnnull;
328
+
else {
329
+
returnthis.username;
330
+
}
332
331
}
333
332
334
333
/**
@@ -350,13 +349,12 @@ public void setPassword(String password) {
350
349
* @since 1.4.0
351
350
*/
352
351
publicStringdeterminePassword() {
353
-
if (StringUtils.hasText(this.password)) {
354
-
returnthis.password;
355
-
}
356
-
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName())) {
352
+
if (EmbeddedDatabaseConnection.isEmbedded(determineDriverClassName()) && !StringUtils.hasText(determineUrl())) {
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,6 @@ private static class EmbeddedDataSourceBeanFactoryPostProcessor implements BeanD
0 commit comments