From 0e50e87e58d0f7a3a44859631526942c3e0e2eb2 Mon Sep 17 00:00:00 2001 From: izeye Date: Tue, 20 Oct 2020 20:47:42 +0900 Subject: [PATCH 1/2] Polish See gh-23762 --- .../boot/autoconfigure/jdbc/DataSourcePropertiesTests.java | 2 -- .../boot/jdbc/EmbeddedDatabaseConnection.java | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java index 0195c23d9b..12f7d1aa1b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java @@ -103,7 +103,6 @@ class DataSourcePropertiesTests { DataSourceProperties properties = new DataSourceProperties(); properties.setUsername(""); properties.afterPropertiesSet(); - assertThat(properties.getUsername()); assertThat(properties.determineUsername()).isEqualTo("sa"); } @@ -112,7 +111,6 @@ class DataSourcePropertiesTests { DataSourceProperties properties = new DataSourceProperties(); properties.setUsername(null); properties.afterPropertiesSet(); - assertThat(properties.getUsername()); assertThat(properties.determineUsername()).isEqualTo("sa"); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java index afc51a0d12..9eb8bf9924 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/EmbeddedDatabaseConnection.java @@ -140,7 +140,7 @@ public enum EmbeddedDatabaseConnection { * database type. * @param driverClass the driver class * @return true if the driver class is one of the embedded types - * @deprecated since 2.3.5 in favor of {@link #isEmbedded(String, String)} + * @deprecated since 2.4.0 in favor of {@link #isEmbedded(String, String)} */ @Deprecated public static boolean isEmbedded(String driverClass) { @@ -151,8 +151,9 @@ public enum EmbeddedDatabaseConnection { * Convenience method to determine if a given driver class name and url represent an * embedded database type. * @param driverClass the driver class - * @param url the jdbc url (can be {@code null)} + * @param url the jdbc url (can be {@code null}) * @return true if the driver class and url refer to an embedded database + * @since 2.4.0 */ public static boolean isEmbedded(String driverClass, String url) { if (driverClass == null) { From 72eaf93dba42216f12f731dc31c28632f69658b5 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 20 Oct 2020 14:37:15 +0200 Subject: [PATCH 2/2] Polish assertions See gh-23762 --- .../boot/autoconfigure/jdbc/DataSourcePropertiesTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java index 12f7d1aa1b..cfa2769395 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java @@ -103,6 +103,7 @@ class DataSourcePropertiesTests { DataSourceProperties properties = new DataSourceProperties(); properties.setUsername(""); properties.afterPropertiesSet(); + assertThat(properties.getUsername()).isEqualTo(""); assertThat(properties.determineUsername()).isEqualTo("sa"); } @@ -111,6 +112,7 @@ class DataSourcePropertiesTests { DataSourceProperties properties = new DataSourceProperties(); properties.setUsername(null); properties.afterPropertiesSet(); + assertThat(properties.getUsername()).isNull(); assertThat(properties.determineUsername()).isEqualTo("sa"); }