diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMeterBinderProvidersConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMeterBinderProvidersConfiguration.java index 6cf880182da8..c4819ee12b91 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMeterBinderProvidersConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMeterBinderProvidersConfiguration.java @@ -34,7 +34,7 @@ import org.springframework.context.annotation.Configuration; /** - * {@link Configuration Auto-configuration} for {@link CacheMeterBinderProvider} beans. + * Configure {@link CacheMeterBinderProvider} beans. * * @author Stephane Nicoll */ diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java index 4304ab6c3e87..4dd7c595462a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java @@ -152,13 +152,11 @@ private Map getConfigurationPropertiesBeans( * @param prefix the prefix * @return the serialized instance */ + @SuppressWarnings("unchecked") private Map safeSerialize(ObjectMapper mapper, Object bean, String prefix) { try { - @SuppressWarnings("unchecked") - Map result = new HashMap<>( - mapper.convertValue(bean, Map.class)); - return result; + return new HashMap<>(mapper.convertValue(bean, Map.class)); } catch (Exception ex) { return new HashMap<>(Collections.singletonMap("error", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java index cfbe4b1b7a53..265209c15a20 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java @@ -185,8 +185,9 @@ public MongoDbFactory withSession(ClientSession session) { } /** - * Check if either a {@link com.mongodb.MongoClient} or - * {@link com.mongodb.client.MongoClient} bean is available. + * Check if either a {@link MongoClient com.mongodb.MongoClient} or + * {@link com.mongodb.client.MongoClient com.mongodb.client.MongoClient} bean is + * available. */ static class AnyMongoClientAvailable extends AnyNestedCondition { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java index d9a6433ab462..64b189196072 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java @@ -220,7 +220,7 @@ private Object getNoJtaPlatformManager() { // Continue searching } } - throw new IllegalStateException("No available JtaPlatform candidates amongst" + throw new IllegalStateException("No available JtaPlatform candidates amongst " + Arrays.toString(NO_JTA_PLATFORM_CLASSES)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfigurationTests.java index b86757f85330..7823151052c6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfigurationTests.java @@ -50,26 +50,22 @@ public void clientExists() { @Test public void optionsAdded() { - this.contextRunner.withPropertyValues("spring.data.mongodb.host:localhost") - .withUserConfiguration(OptionsConfig.class) + this.contextRunner.withUserConfiguration(OptionsConfig.class) .run((context) -> assertThat(context.getBean(MongoClient.class) .getMongoClientOptions().getSocketTimeout()).isEqualTo(300)); } @Test public void optionsAddedButNoHost() { - this.contextRunner - .withPropertyValues("spring.data.mongodb.uri:mongodb://localhost/test") - .withUserConfiguration(OptionsConfig.class) + this.contextRunner.withUserConfiguration(OptionsConfig.class) .run((context) -> assertThat(context.getBean(MongoClient.class) .getMongoClientOptions().getSocketTimeout()).isEqualTo(300)); } @Test public void optionsSslConfig() { - this.contextRunner - .withPropertyValues("spring.data.mongodb.uri:mongodb://localhost/test") - .withUserConfiguration(SslOptionsConfig.class).run((context) -> { + this.contextRunner.withUserConfiguration(SslOptionsConfig.class) + .run((context) -> { assertThat(context).hasSingleBean(MongoClient.class); MongoClient mongo = context.getBean(MongoClient.class); MongoClientOptions options = mongo.getMongoClientOptions(); @@ -81,9 +77,8 @@ public void optionsSslConfig() { @Test public void doesNotCreateMongoClientWhenAlreadyDefined() { - this.contextRunner - .withPropertyValues("spring.data.mongodb.uri:mongodb://localhost/test") - .withUserConfiguration(FallbackMongoClientConfig.class).run((context) -> { + this.contextRunner.withUserConfiguration(FallbackMongoClientConfig.class) + .run((context) -> { assertThat(context).doesNotHaveBean(MongoClient.class); assertThat(context) .hasSingleBean(com.mongodb.client.MongoClient.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityRequestMatcherProviderAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityRequestMatcherProviderAutoConfigurationTests.java index 8309842d21fa..74bafb9ad704 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityRequestMatcherProviderAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityRequestMatcherProviderAutoConfigurationTests.java @@ -40,7 +40,7 @@ public class SecurityRequestMatcherProviderAutoConfigurationTests { .withUserConfiguration(TestConfiguration.class); @Test - public void registersMvcRequestMatcherProviderForIfMvcPresent() { + public void registersMvcRequestMatcherProviderIfMvcPresent() { this.contextRunner.run((context) -> assertThat(context) .hasSingleBean(MvcRequestMatcherProvider.class)); } diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 766597b95f5d..b11ef639d6a9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -555,7 +555,7 @@ Consider the following JSON request body: } ---- -This can be used to invoke a write operation that takes a `String test` and `int counter` +This can be used to invoke a write operation that takes `String name` and `int counter` parameters. TIP: Because endpoints are technology agnostic, only simple types can be specified in the diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 097b25fdd4a3..1b7af6b51060 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -6723,7 +6723,7 @@ mapper, which can be one of the following libraries: * `Gson` * `Jsonb` -TIP: A list of the auto-configuration that is enabled by `@JsonTest` can be +TIP: A list of the auto-configurations that are enabled by `@JsonTest` can be <>. If you need to configure elements of the auto-configuration, you can use the @@ -6906,7 +6906,7 @@ auto-configures the Spring WebFlux infrastructure and limits scanned beans to `WebFluxConfigurer`. Regular `@Component` beans are not scanned when the `@WebFluxTest` annotation is used. -TIP: A list of the auto-configuration that is enabled by `@WebFluxTest` can be +TIP: A list of the auto-configurations that are enabled by `@WebFluxTest` can be <>. TIP: If you need to register extra components, such as Jackson `Module`, you can import @@ -7066,7 +7066,7 @@ following example: `DataSource`. By default, it configures an in-memory embedded database and a `JdbcTemplate`. Regular `@Component` beans are not loaded into the `ApplicationContext`. -TIP: A list of the auto-configuration that is enabled by `@JdbcTest` can be +TIP: A list of the auto-configurations that are enabled by `@JdbcTest` can be <>. By default, JDBC tests are transactional and roll back at the end of each test. See the @@ -7107,7 +7107,7 @@ you can use `@AutoConfigureTestDatabase` to override those settings. (For more a jOOQ with Spring Boot, see "<>", earlier in this chapter.) Regular `@Component` beans are not loaded into the `ApplicationContext`. -TIP: A list of the auto-configuration that is enabled by `@JooqTest` can be +TIP: A list of the auto-configurations that are enabled by `@JooqTest` can be <>. `@JooqTest` configures a `DSLContext`. Regular `@Component` beans are not loaded into the @@ -7492,7 +7492,7 @@ include::{code-examples}/test/autoconfigure/restdocs/restassured/AdvancedConfigu ==== Additional Auto-configuration and Slicing Each slice provides one or more `@AutoConfigure...` annotations that namely defines the auto-configurations that should be included as part of a slice. Additional -auto-configurations can be added by creating a custom `@AutoConfigure` annotation or +auto-configurations can be added by creating a custom `@AutoConfigure...` annotation or simply by adding `@ImportAutoConfiguration` to the test as shown in the following example: [source,java,indent=0] diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java index 11f13e757b0a..4da38e6353d5 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/JacksonJsonParser.java @@ -37,7 +37,7 @@ public class JacksonJsonParser extends AbstractJsonParser { private ObjectMapper objectMapper; // Late binding /** - * Creates a instance with the specified {@link ObjectMapper}. + * Creates an instance with the specified {@link ObjectMapper}. * @param objectMapper the object mapper to use */ public JacksonJsonParser(ObjectMapper objectMapper) {