diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerDelegate.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerDelegate.java index 252757868e1..6c187a06921 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerDelegate.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerDelegate.java @@ -17,7 +17,7 @@ package org.springframework.jdbc.datasource.embedded; /** - * A {@link EmbeddedDatabaseConfigurer} delegate that can be used to customize + * An {@link EmbeddedDatabaseConfigurer} delegate that can be used to customize * the embedded database. * * @author Stephane Nicoll diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurers.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurers.java index 59373ac4aa8..e748d34164b 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurers.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurers.java @@ -53,8 +53,8 @@ public abstract class EmbeddedDatabaseConfigurers { } /** - * Customize the default configurer for the given embedded database type. The - * {@code customizer} operator typically uses + * Customize the default configurer for the given embedded database type. + *
The {@code customizer} typically uses * {@link EmbeddedDatabaseConfigurerDelegate} to customize things as necessary. * @param type the {@linkplain EmbeddedDatabaseType embedded database type} * @param customizer the customizer to return based on the default diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java index 357e3f2eb06..479d6104f84 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java @@ -45,11 +45,11 @@ import org.springframework.util.Assert; * for the database. *
Call this when you wish to configure one of the pre-supported types - * with their default settings. + * with its default settings. *
Defaults to HSQL.
* @param type the database type
*/
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java
index ad42c8d2d2d..f020350a26a 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java
@@ -293,7 +293,8 @@ class NamedParameterUtilsTests {
"SELECT /*:doo*/':foo', :xxx FROM DUAL",
"SELECT ':foo'/*:doo*/, :xxx FROM DUAL",
"SELECT \":foo\"\":doo\", :xxx FROM DUAL",
- "SELECT `:foo``:doo`, :xxx FROM DUAL",})
+ "SELECT `:foo``:doo`, :xxx FROM DUAL"
+ })
void parseSqlStatementWithParametersInsideQuote(String sql) {
ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql);
assertThat(parsedSql.getTotalParameterCount()).isEqualTo(1);
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilderTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilderTests.java
index eb1c41d27ac..d496f4a59f8 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilderTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilderTests.java
@@ -36,33 +36,32 @@ import static org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType.
*/
class EmbeddedDatabaseBuilderTests {
- private final EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(
- getClass()));
+ private final EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass()));
@Test
void addDefaultScripts() {
doTwice(() -> {
- EmbeddedDatabase db = new EmbeddedDatabaseBuilder()//
- .addDefaultScripts()//
- .build();
+ EmbeddedDatabase db = new EmbeddedDatabaseBuilder()
+ .addDefaultScripts()
+ .build();
assertDatabaseCreatedAndShutdown(db);
});
}
@Test
void addScriptWithBogusFileName() {
- assertThatExceptionOfType(CannotReadScriptException.class).isThrownBy(
- new EmbeddedDatabaseBuilder().addScript("bogus.sql")::build);
+ assertThatExceptionOfType(CannotReadScriptException.class)
+ .isThrownBy(new EmbeddedDatabaseBuilder().addScript("bogus.sql")::build);
}
@Test
void addScript() {
doTwice(() -> {
- EmbeddedDatabase db = builder//
- .addScript("db-schema.sql")//
- .addScript("db-test-data.sql")//
- .build();
+ EmbeddedDatabase db = builder
+ .addScript("db-schema.sql")
+ .addScript("db-test-data.sql")
+ .build();
assertDatabaseCreatedAndShutdown(db);
});
}
@@ -70,9 +69,9 @@ class EmbeddedDatabaseBuilderTests {
@Test
void addScripts() {
doTwice(() -> {
- EmbeddedDatabase db = builder//
- .addScripts("db-schema.sql", "db-test-data.sql")//
- .build();
+ EmbeddedDatabase db = builder
+ .addScripts("db-schema.sql", "db-test-data.sql")
+ .build();
assertDatabaseCreatedAndShutdown(db);
});
}
@@ -80,9 +79,9 @@ class EmbeddedDatabaseBuilderTests {
@Test
void addScriptsWithDefaultCommentPrefix() {
doTwice(() -> {
- EmbeddedDatabase db = builder//
- .addScripts("db-schema-comments.sql", "db-test-data.sql")//
- .build();
+ EmbeddedDatabase db = builder
+ .addScripts("db-schema-comments.sql", "db-test-data.sql")
+ .build();
assertDatabaseCreatedAndShutdown(db);
});
}
@@ -90,10 +89,10 @@ class EmbeddedDatabaseBuilderTests {
@Test
void addScriptsWithCustomCommentPrefix() {
doTwice(() -> {
- EmbeddedDatabase db = builder//
- .addScripts("db-schema-custom-comments.sql", "db-test-data.sql")//
- .setCommentPrefix("~")//
- .build();
+ EmbeddedDatabase db = builder
+ .addScripts("db-schema-custom-comments.sql", "db-test-data.sql")
+ .setCommentPrefix("~")
+ .build();
assertDatabaseCreatedAndShutdown(db);
});
}
@@ -101,11 +100,11 @@ class EmbeddedDatabaseBuilderTests {
@Test
void addScriptsWithCustomBlockComments() {
doTwice(() -> {
- EmbeddedDatabase db = builder//
- .addScripts("db-schema-block-comments.sql", "db-test-data.sql")//
- .setBlockCommentStartDelimiter("{*")//
- .setBlockCommentEndDelimiter("*}")//
- .build();
+ EmbeddedDatabase db = builder
+ .addScripts("db-schema-block-comments.sql", "db-test-data.sql")
+ .setBlockCommentStartDelimiter("{*")
+ .setBlockCommentEndDelimiter("*}")
+ .build();
assertDatabaseCreatedAndShutdown(db);
});
}
@@ -113,10 +112,10 @@ class EmbeddedDatabaseBuilderTests {
@Test
void setTypeToH2() {
doTwice(() -> {
- EmbeddedDatabase db = builder//
- .setType(H2)//
- .addScripts("db-schema.sql", "db-test-data.sql")//
- .build();
+ EmbeddedDatabase db = builder
+ .setType(H2)
+ .addScripts("db-schema.sql", "db-test-data.sql")
+ .build();
assertDatabaseCreatedAndShutdown(db);
});
}
@@ -132,7 +131,7 @@ class EmbeddedDatabaseBuilderTests {
super.configureConnectionProperties(properties, databaseName);
}
}))
- .addScripts("db-schema.sql", "db-test-data.sql")//
+ .addScripts("db-schema.sql", "db-test-data.sql")
.build();
assertDatabaseCreatedAndShutdown(db);
});
@@ -141,18 +140,17 @@ class EmbeddedDatabaseBuilderTests {
@Test
void setTypeToDerbyAndIgnoreFailedDrops() {
doTwice(() -> {
- EmbeddedDatabase db = builder//
- .setType(DERBY)//
- .ignoreFailedDrops(true)//
- .addScripts("db-schema-derby-with-drop.sql", "db-test-data.sql").build();
+ EmbeddedDatabase db = builder
+ .setType(DERBY)
+ .ignoreFailedDrops(true)
+ .addScripts("db-schema-derby-with-drop.sql", "db-test-data.sql").build();
assertDatabaseCreatedAndShutdown(db);
});
}
@Test
void createSameSchemaTwiceWithoutUniqueDbNames() {
- EmbeddedDatabase db1 = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass()))
- .addScripts("db-schema-without-dropping.sql").build();
+ EmbeddedDatabase db1 = builder.addScripts("db-schema-without-dropping.sql").build();
try {
assertThatExceptionOfType(ScriptStatementFailedException.class).isThrownBy(() ->
new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass())).addScripts("db-schema-without-dropping.sql").build());
@@ -164,20 +162,20 @@ class EmbeddedDatabaseBuilderTests {
@Test
void createSameSchemaTwiceWithGeneratedUniqueDbNames() {
- EmbeddedDatabase db1 = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass()))//
- .addScripts("db-schema-without-dropping.sql", "db-test-data.sql")//
- .generateUniqueName(true)//
- .build();
+ EmbeddedDatabase db1 = builder
+ .addScripts("db-schema-without-dropping.sql", "db-test-data.sql")
+ .generateUniqueName(true)
+ .build();
JdbcTemplate template1 = new JdbcTemplate(db1);
assertNumRowsInTestTable(template1, 1);
template1.update("insert into T_TEST (NAME) values ('Sam')");
assertNumRowsInTestTable(template1, 2);
- EmbeddedDatabase db2 = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass()))//
- .addScripts("db-schema-without-dropping.sql", "db-test-data.sql")//
- .generateUniqueName(true)//
- .build();
+ EmbeddedDatabase db2 = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass()))
+ .addScripts("db-schema-without-dropping.sql", "db-test-data.sql")
+ .generateUniqueName(true)
+ .build();
assertDatabaseCreated(db2);
db1.shutdown();
diff --git a/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java b/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java
index 65ec8d92580..00771118bed 100644
--- a/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java
+++ b/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java
@@ -58,6 +58,16 @@ public class JsonPathExpectationsHelper {
private final Configuration configuration;
+ /**
+ * Construct a new {@code JsonPathExpectationsHelper} using the
+ * {@linkplain Configuration#defaultConfiguration() default configuration}.
+ * @param expression the {@link JsonPath} expression; never {@code null} or empty
+ * @since 6.2
+ */
+ public JsonPathExpectationsHelper(String expression) {
+ this(expression, (Configuration) null);
+ }
+
/**
* Construct a new {@code JsonPathExpectationsHelper}.
* @param expression the {@link JsonPath} expression; never {@code null} or empty
@@ -72,16 +82,6 @@ public class JsonPathExpectationsHelper {
this.configuration = (configuration != null) ? configuration : Configuration.defaultConfiguration();
}
- /**
- * Construct a new {@code JsonPathExpectationsHelper} using the
- * {@linkplain Configuration#defaultConfiguration() default configuration}.
- * @param expression the {@link JsonPath} expression; never {@code null} or empty
- * @since 6.2
- */
- public JsonPathExpectationsHelper(String expression) {
- this(expression, (Configuration) null);
- }
-
/**
* Construct a new {@code JsonPathExpectationsHelper}.
* @param expression the {@link JsonPath} expression; never {@code null} or empty
diff --git a/spring-test/src/main/java/org/springframework/test/web/reactive/server/JsonEncoderDecoder.java b/spring-test/src/main/java/org/springframework/test/web/reactive/server/JsonEncoderDecoder.java
index bb1bc6fc72f..cc3907097d4 100644
--- a/spring-test/src/main/java/org/springframework/test/web/reactive/server/JsonEncoderDecoder.java
+++ b/spring-test/src/main/java/org/springframework/test/web/reactive/server/JsonEncoderDecoder.java
@@ -32,11 +32,11 @@ import org.springframework.lang.Nullable;
/**
* {@link Encoder} and {@link Decoder} that is able to handle a map to and from
- * json. Used to configure the jsonpath infrastructure without having a hard
+ * JSON. Used to configure the jsonpath infrastructure without having a hard
* dependency on the library.
*
- * @param encoder the json encoder
- * @param decoder the json decoder
+ * @param encoder the JSON encoder
+ * @param decoder the JSON decoder
* @author Stephane Nicoll
* @author Rossen Stoyanchev
* @since 6.2
@@ -69,9 +69,9 @@ record JsonEncoderDecoder(Encoder> encoder, Decoder> decoder) {
/**
* Find the first suitable {@link Encoder} that can encode a {@link Map}
- * to json.
+ * to JSON.
* @param writers the writers to inspect
- * @return a suitable json {@link Encoder} or {@code null}
+ * @return a suitable JSON {@link Encoder} or {@code null}
*/
@Nullable
private static Encoder> findJsonEncoder(Collection