From 2816635418f95465deeddddd5c0a6a46b4527559 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 4 Jul 2019 17:45:28 +0100 Subject: [PATCH] Polish --- ...hutdownEndpointAutoConfigurationTests.java | 1 + .../annotation/RequestPredicateFactory.java | 4 +- .../web/annotation/WebEndpointDiscoverer.java | 4 +- .../actuate/redis/RedisHealthIndicator.java | 2 +- ...2ResourceServerAutoConfigurationTests.java | 4 +- .../web/ServerPropertiesTests.java | 8 +-- ...stEmbeddedReactiveWebEnvironmentTests.java | 2 + ...gBootTestWebServerWebEnvironmentTests.java | 2 + .../gradle/junit/GradleMultiDslExtension.java | 1 + .../boot/gradle/testkit/Dsl.java | 8 +-- .../gradle/testkit/GradleBuildExtension.java | 1 + .../boot/loader/PropertiesLauncher.java | 14 +++-- .../loader/archive/ExplodedArchiveTests.java | 57 ++++++++++++------- .../testcontainers/package-info.java | 20 +++++++ ...ConfigurationPropertiesBeanDefinition.java | 5 +- ...tionPropertiesBeanDefinitionRegistrar.java | 5 +- .../ConfigurationPropertiesBinder.java | 2 +- .../ConfigurationPropertiesBinding.java | 4 +- ...urationPropertiesBindingPostProcessor.java | 2 +- ...opertiesBindingPostProcessorRegistrar.java | 2 +- .../ConfigurationPropertiesScan.java | 10 ++-- .../ConfigurationPropertiesScanRegistrar.java | 4 +- .../DeprecatedConfigurationProperty.java | 9 +-- .../EnableConfigurationProperties.java | 13 +++-- ...validConfigurationPropertiesException.java | 3 +- .../NestedConfigurationProperty.java | 13 +++-- .../boot/jackson/JsonComponent.java | 9 +-- .../boot/jackson/JsonComponentModule.java | 4 +- ...onConfigReactiveWebApplicationContext.java | 8 +-- .../ServletComponentScanRegistrar.java | 3 +- .../boot/web/servlet/WebFilterHandler.java | 2 +- .../boot/web/servlet/WebListenerHandler.java | 2 +- .../boot/web/servlet/WebServletHandler.java | 2 +- .../web/servlet/error/ErrorAttributes.java | 3 +- .../ConfigurationPropertiesScanTests.java | 2 +- .../ConfigurationPropertiesTests.java | 4 +- ...figurationPropertiesScanConfiguration.java | 2 +- .../convert/MockDataSizeTypeDescriptor.java | 3 +- .../convert/MockDurationTypeDescriptor.java | 4 +- .../boot/jackson/NameAndAgeJsonComponent.java | 2 +- .../jackson/NameAndAgeJsonKeyComponent.java | 2 +- .../jackson/NameAndCareerJsonComponent.java | 2 +- .../boot/web/server/LocalServerPortTests.java | 2 +- .../ServletComponentScanIntegrationTests.java | 2 +- 44 files changed, 151 insertions(+), 107 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/package-info.java diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/ShutdownEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/ShutdownEndpointAutoConfigurationTests.java index 4435c173d9..2c6d14f4aa 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/ShutdownEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/ShutdownEndpointAutoConfigurationTests.java @@ -39,6 +39,7 @@ class ShutdownEndpointAutoConfigurationTests { .withConfiguration(AutoConfigurations.of(ShutdownEndpointAutoConfiguration.class)); @Test + @SuppressWarnings("unchecked") void runShouldHaveEndpointBeanThatIsNotDisposable() { this.contextRunner.withPropertyValues("management.endpoint.shutdown.enabled:true") .withPropertyValues("management.endpoints.web.exposure.include=shutdown").run((context) -> { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java index 6451674ea9..23bd5cf673 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java @@ -23,7 +23,6 @@ import java.util.Collections; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.springframework.boot.actuate.endpoint.EndpointId; import org.springframework.boot.actuate.endpoint.OperationType; import org.springframework.boot.actuate.endpoint.annotation.DiscoveredOperationMethod; import org.springframework.boot.actuate.endpoint.annotation.Selector; @@ -51,8 +50,7 @@ class RequestPredicateFactory { this.endpointMediaTypes = endpointMediaTypes; } - WebOperationRequestPredicate getRequestPredicate(EndpointId endpointId, String rootPath, - DiscoveredOperationMethod operationMethod) { + WebOperationRequestPredicate getRequestPredicate(String rootPath, DiscoveredOperationMethod operationMethod) { Method method = operationMethod.getMethod(); String path = getPath(rootPath, method); WebEndpointHttpMethod httpMethod = determineHttpMethod(operationMethod.getOperationType()); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscoverer.java index aff2bcf9e5..42d4d631b4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscoverer.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscoverer.java @@ -76,8 +76,8 @@ public class WebEndpointDiscoverer extends EndpointDiscoverer filters = filterChain.getWebFilters().toStream(); AuthenticationWebFilter webFilter = (AuthenticationWebFilter) filters .filter((f) -> f instanceof AuthenticationWebFilter).findFirst().orElse(null); - ReactiveAuthenticationManagerResolver authenticationManagerResolver = (ReactiveAuthenticationManagerResolver) ReflectionTestUtils + ReactiveAuthenticationManagerResolver authenticationManagerResolver = (ReactiveAuthenticationManagerResolver) ReflectionTestUtils .getField(webFilter, "authenticationManagerResolver"); Object authenticationManager = authenticationManagerResolver.resolve(null).block(); assertThat(authenticationManager).isInstanceOf(JwtReactiveAuthenticationManager.class); @@ -302,7 +302,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests { Stream filters = filterChain.getWebFilters().toStream(); AuthenticationWebFilter webFilter = (AuthenticationWebFilter) filters .filter((f) -> f instanceof AuthenticationWebFilter).findFirst().orElse(null); - ReactiveAuthenticationManagerResolver authenticationManagerResolver = (ReactiveAuthenticationManagerResolver) ReflectionTestUtils + ReactiveAuthenticationManagerResolver authenticationManagerResolver = (ReactiveAuthenticationManagerResolver) ReflectionTestUtils .getField(webFilter, "authenticationManagerResolver"); Object authenticationManager = authenticationManagerResolver.resolve(null).block(); assertThat(authenticationManager).isInstanceOf(OAuth2IntrospectionReactiveAuthenticationManager.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index b1bc91973a..eee30bf188 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -217,15 +217,15 @@ class ServerPropertiesTests { @Test void testCustomizeUndertowServerOption() { bind("server.undertow.options.server.ALWAYS_SET_KEEP_ALIVE", "true"); - assertThat(this.properties.getUndertow().getOptions().getServer().containsKey("ALWAYS_SET_KEEP_ALIVE")); - assertThat(this.properties.getUndertow().getOptions().getServer().get("ALWAYS_SET_KEEP_ALIVE").equals("true")); + assertThat(this.properties.getUndertow().getOptions().getServer()).containsEntry("ALWAYS_SET_KEEP_ALIVE", + "true"); } @Test void testCustomizeUndertowSocketOption() { bind("server.undertow.options.socket.ALWAYS_SET_KEEP_ALIVE", "true"); - assertThat(this.properties.getUndertow().getOptions().getSocket().containsKey("ALWAYS_SET_KEEP_ALIVE")); - assertThat(this.properties.getUndertow().getOptions().getSocket().get("ALWAYS_SET_KEEP_ALIVE").equals("true")); + assertThat(this.properties.getUndertow().getOptions().getSocket()).containsEntry("ALWAYS_SET_KEEP_ALIVE", + "true"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java index 775b2a143e..b868f702a5 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java @@ -28,6 +28,7 @@ import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.http.server.reactive.HttpHandler; import org.springframework.test.web.reactive.server.WebTestClient; @@ -86,6 +87,7 @@ abstract class AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests { assertThat(this.value).isEqualTo(123); } + @Configuration(proxyBeanMethods = false) static class AbstractConfig { @Value("${server.port:8080}") diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java index 461538088b..a7ff851e6f 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java @@ -27,6 +27,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactor import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.client.RestTemplate; @@ -91,6 +92,7 @@ abstract class AbstractSpringBootTestWebServerWebEnvironmentTests { assertThat(this.context).isSameAs(WebApplicationContextUtils.getWebApplicationContext(this.servletContext)); } + @Configuration(proxyBeanMethods = false) static class AbstractConfig { @Value("${server.port:8080}") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleMultiDslExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleMultiDslExtension.java index a184896c27..34f91a54a0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleMultiDslExtension.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleMultiDslExtension.java @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Stream; +import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.extension.Extension; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.TestTemplateInvocationContext; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/Dsl.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/Dsl.java index ccda5ed61e..28463b8077 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/Dsl.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/Dsl.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,16 +31,10 @@ public enum Dsl { this.extension = extension; } - /** - * Gets the user-friendly name of the DSL - */ public String getName() { return this.name; } - /** - * Gets the file extension of build scripts (starting with a dot) - */ String getExtension() { return this.extension; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuildExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuildExtension.java index 2541121a41..eadf21d445 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuildExtension.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuildExtension.java @@ -22,6 +22,7 @@ import java.util.regex.Pattern; import org.junit.jupiter.api.extension.AfterEachCallback; import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.Extension; import org.junit.jupiter.api.extension.ExtensionContext; import org.springframework.util.ReflectionUtils; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java index 84303bfe5a..75e48d507e 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java @@ -418,12 +418,14 @@ public class PropertiesLauncher extends Launcher { try { if (this.home != null) { // Prefer home dir for MANIFEST if there is one - Manifest manifest = new ExplodedArchive(this.home, false).getManifest(); - if (manifest != null) { - String value = manifest.getMainAttributes().getValue(manifestKey); - if (value != null) { - debug("Property '" + manifestKey + "' from home directory manifest: " + value); - return SystemPropertyUtils.resolvePlaceholders(this.properties, value); + try (ExplodedArchive archive = new ExplodedArchive(this.home, false)) { + Manifest manifest = archive.getManifest(); + if (manifest != null) { + String value = manifest.getMainAttributes().getValue(manifestKey); + if (value != null) { + debug("Property '" + manifestKey + "' from home directory manifest: " + value); + return SystemPropertyUtils.resolvePlaceholders(this.properties, value); + } } } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/ExplodedArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/ExplodedArchiveTests.java index 034bd49d14..6c4579151e 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/ExplodedArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/ExplodedArchiveTests.java @@ -27,6 +27,7 @@ import java.util.UUID; import java.util.jar.JarEntry; import java.util.jar.JarFile; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -59,6 +60,13 @@ class ExplodedArchiveTests { createArchive(); } + @AfterEach + void tearDown() throws Exception { + if (this.archive != null) { + this.archive.close(); + } + } + private void createArchive() throws Exception { createArchive(null); } @@ -126,44 +134,49 @@ class ExplodedArchiveTests { } @Test - void getNonRecursiveEntriesForRoot() { - ExplodedArchive archive = new ExplodedArchive(new File("/"), false); - Map entries = getEntriesMap(archive); - assertThat(entries.size()).isGreaterThan(1); + void getNonRecursiveEntriesForRoot() throws Exception { + try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("/"), false)) { + Map entries = getEntriesMap(explodedArchive); + assertThat(entries.size()).isGreaterThan(1); + } } @Test void getNonRecursiveManifest() throws Exception { - ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root")); - assertThat(archive.getManifest()).isNotNull(); - Map entries = getEntriesMap(archive); - assertThat(entries.size()).isEqualTo(4); + try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"))) { + assertThat(explodedArchive.getManifest()).isNotNull(); + Map entries = getEntriesMap(explodedArchive); + assertThat(entries.size()).isEqualTo(4); + } } @Test void getNonRecursiveManifestEvenIfNonRecursive() throws Exception { - ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root"), false); - assertThat(archive.getManifest()).isNotNull(); - Map entries = getEntriesMap(archive); - assertThat(entries.size()).isEqualTo(3); + try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"), false)) { + assertThat(this.archive.getManifest()).isNotNull(); + Map entries = getEntriesMap(this.archive); + assertThat(entries.size()).isEqualTo(3); + } } @Test void getResourceAsStream() throws Exception { - ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root")); - assertThat(archive.getManifest()).isNotNull(); - URLClassLoader loader = new URLClassLoader(new URL[] { archive.getUrl() }); - assertThat(loader.getResourceAsStream("META-INF/spring/application.xml")).isNotNull(); - loader.close(); + try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"))) { + assertThat(explodedArchive.getManifest()).isNotNull(); + URLClassLoader loader = new URLClassLoader(new URL[] { explodedArchive.getUrl() }); + assertThat(loader.getResourceAsStream("META-INF/spring/application.xml")).isNotNull(); + loader.close(); + } } @Test void getResourceAsStreamNonRecursive() throws Exception { - ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root"), false); - assertThat(archive.getManifest()).isNotNull(); - URLClassLoader loader = new URLClassLoader(new URL[] { archive.getUrl() }); - assertThat(loader.getResourceAsStream("META-INF/spring/application.xml")).isNotNull(); - loader.close(); + try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"), false)) { + assertThat(explodedArchive.getManifest()).isNotNull(); + URLClassLoader loader = new URLClassLoader(new URL[] { explodedArchive.getUrl() }); + assertThat(loader.getResourceAsStream("META-INF/spring/application.xml")).isNotNull(); + loader.close(); + } } private Map getEntriesMap(Archive archive) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/package-info.java new file mode 100644 index 0000000000..4c85d07660 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing with Testcontainers. + */ +package org.springframework.boot.testsupport.testcontainers; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinition.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinition.java index 64d257b66c..b424e719e2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinition.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinition.java @@ -27,8 +27,9 @@ import org.springframework.core.annotation.AnnotationUtils; import org.springframework.validation.annotation.Validated; /** - * {@link BeanDefinition} that is used for registering {@link ConfigurationProperties} - * beans that are bound at creation time. + * {@link BeanDefinition} that is used for registering + * {@link ConfigurationProperties @ConfigurationProperties} beans that are bound at + * creation time. * * @author Stephane Nicoll * @author Madhura Bhave diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinitionRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinitionRegistrar.java index 91de83a24b..4244dcd0b1 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinitionRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinitionRegistrar.java @@ -34,8 +34,9 @@ import org.springframework.util.Assert; import org.springframework.util.StringUtils; /** - * Registers a bean definition for a type annotated with {@link ConfigurationProperties} - * using the prefix of the annotation in the bean name. + * Registers a bean definition for a type annotated with + * {@link ConfigurationProperties @ConfigurationProperties} using the prefix of the + * annotation in the bean name. * * @author Madhura Bhave */ diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java index 30dc21392e..de306aeced 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java @@ -46,7 +46,7 @@ import org.springframework.validation.annotation.Validated; /** * Internal class by the {@link ConfigurationPropertiesBindingPostProcessor} to handle the - * actual {@link ConfigurationProperties} binding. + * actual {@link ConfigurationProperties @ConfigurationProperties} binding. * * @author Stephane Nicoll * @author Phillip Webb diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinding.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinding.java index 472c3a6d89..5dc39387ff 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinding.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinding.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Qualifier; /** * Qualifier for beans that are needed to configure the binding of - * {@link ConfigurationProperties} (e.g. Converters). + * {@link ConfigurationProperties @ConfigurationProperties} (e.g. Converters). * * @author Dave Syer * @since 1.3.0 diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index 0dbc5e7430..879f0e0170 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -36,7 +36,7 @@ import org.springframework.validation.annotation.Validated; /** * {@link BeanPostProcessor} to bind {@link PropertySources} to beans annotated with - * {@link ConfigurationProperties}. + * {@link ConfigurationProperties @ConfigurationProperties}. * * @author Dave Syer * @author Phillip Webb diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorRegistrar.java index e13107e84d..f58378ad16 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorRegistrar.java @@ -24,7 +24,7 @@ import org.springframework.core.type.AnnotationMetadata; /** * {@link ImportBeanDefinitionRegistrar} for binding externalized application properties - * to {@link ConfigurationProperties} beans. + * to {@link ConfigurationProperties @ConfigurationProperties} beans. * * @author Dave Syer * @author Phillip Webb diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScan.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScan.java index c4d7ef4b63..e900d5d422 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScan.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScan.java @@ -25,11 +25,11 @@ import org.springframework.context.annotation.Import; import org.springframework.core.annotation.AliasFor; /** - * Configures the base packages used when scanning for {@link ConfigurationProperties} - * classes. One of {@link #basePackageClasses()}, {@link #basePackages()} or its alias - * {@link #value()} may be specified to define specific packages to scan. If specific - * packages are not defined scanning will occur from the package of the class with this - * annotation. + * Configures the base packages used when scanning for + * {@link ConfigurationProperties @ConfigurationProperties} classes. One of + * {@link #basePackageClasses()}, {@link #basePackages()} or its alias {@link #value()} + * may be specified to define specific packages to scan. If specific packages are not + * defined scanning will occur from the package of the class with this annotation. * * @author Madhura Bhave * @since 2.2.0 diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanRegistrar.java index b6e02e8c4a..8a3dcb9576 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanRegistrar.java @@ -38,8 +38,8 @@ import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; /** - * {@link ImportBeanDefinitionRegistrar} for registering {@link ConfigurationProperties} - * bean definitions via scanning. + * {@link ImportBeanDefinitionRegistrar} for registering + * {@link ConfigurationProperties @ConfigurationProperties} bean definitions via scanning. * * @author Madhura Bhave */ diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/DeprecatedConfigurationProperty.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/DeprecatedConfigurationProperty.java index f73dd53ff1..23940cde12 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/DeprecatedConfigurationProperty.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/DeprecatedConfigurationProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +23,10 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Indicates that a getter in a {@link ConfigurationProperties} object is deprecated. This - * annotation has no bearing on the actual binding processes, but it is used by the - * {@code spring-boot-configuration-processor} to add deprecation meta-data. + * Indicates that a getter in a {@link ConfigurationProperties @ConfigurationProperties} + * object is deprecated. This annotation has no bearing on the actual binding processes, + * but it is used by the {@code spring-boot-configuration-processor} to add deprecation + * meta-data. *

* This annotation must be used on the getter of the deprecated element. * diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationProperties.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationProperties.java index a179a05c90..74f8c6de8b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationProperties.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationProperties.java @@ -26,9 +26,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; /** - * Enable support for {@link ConfigurationProperties} annotated beans. - * {@link ConfigurationProperties} beans can be registered in the standard way (for - * example using {@link Bean @Bean} methods) or, for convenience, can be specified + * Enable support for {@link ConfigurationProperties @ConfigurationProperties} annotated + * beans. {@code @ConfigurationProperties} beans can be registered in the standard way + * (for example using {@link Bean @Bean} methods) or, for convenience, can be specified * directly on this annotation. * * @author Dave Syer @@ -41,9 +41,10 @@ import org.springframework.context.annotation.Import; public @interface EnableConfigurationProperties { /** - * Convenient way to quickly register {@link ConfigurationProperties} annotated beans - * with Spring. Standard Spring Beans will also be scanned regardless of this value. - * @return {@link ConfigurationProperties} annotated beans to register + * Convenient way to quickly register + * {@link ConfigurationProperties @ConfigurationProperties} annotated beans with + * Spring. Standard Spring Beans will also be scanned regardless of this value. + * @return {@code @ConfigurationProperties} annotated beans to register */ Class[] value() default {}; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/InvalidConfigurationPropertiesException.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/InvalidConfigurationPropertiesException.java index 2e611d94e4..74cba661a2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/InvalidConfigurationPropertiesException.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/InvalidConfigurationPropertiesException.java @@ -19,7 +19,8 @@ package org.springframework.boot.context.properties; import org.springframework.util.Assert; /** - * Exception thrown when a {@link ConfigurationProperties} has been misconfigured. + * Exception thrown when a {@link ConfigurationProperties @ConfigurationProperties} has + * been misconfigured. * * @author Madhura Bhave * @since 2.2.0 diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NestedConfigurationProperty.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NestedConfigurationProperty.java index 782373ecee..9beee6c183 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NestedConfigurationProperty.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/NestedConfigurationProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,12 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Indicates that a field in a {@link ConfigurationProperties} object should be treated as - * if it were a nested type. This annotation has no bearing on the actual binding - * processes, but it is used by the {@code spring-boot-configuration-processor} as a hint - * that a field is not bound as a single value. When this is specified, a nested group is - * created for the field and its type is harvested. + * Indicates that a field in a {@link ConfigurationProperties @ConfigurationProperties} + * object should be treated as if it were a nested type. This annotation has no bearing on + * the actual binding processes, but it is used by the + * {@code spring-boot-configuration-processor} as a hint that a field is not bound as a + * single value. When this is specified, a nested group is created for the field and its + * type is harvested. *

* This has no effect on collections and maps as these types are automatically identified. * diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java index 134b634791..121e68f3fe 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java @@ -30,10 +30,11 @@ import org.springframework.core.annotation.AliasFor; import org.springframework.stereotype.Component; /** - * {@link Component} that provides {@link JsonSerializer}, {@link JsonDeserializer} or - * {@link KeyDeserializer} implementations to be registered with Jackson when - * {@link JsonComponentModule} is in use. Can be used to annotate implementations directly - * or a class that contains them as inner-classes. For example:

+ * {@link Component @Component} that provides {@link JsonSerializer},
+ * {@link JsonDeserializer} or {@link KeyDeserializer} implementations to be registered
+ * with Jackson when {@link JsonComponentModule} is in use. Can be used to annotate
+ * implementations directly or a class that contains them as inner-classes. For example:
+ * 
  * @JsonComponent
  * public class CustomerJsonComponent {
  *
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponentModule.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponentModule.java
index d6ab704380..bcf6a43658 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponentModule.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponentModule.java
@@ -43,8 +43,8 @@ import org.springframework.util.Assert;
 import org.springframework.util.ObjectUtils;
 
 /**
- * Spring Bean and Jackson {@link Module} to register {@link JsonComponent} annotated
- * beans.
+ * Spring Bean and Jackson {@link Module} to register {@link JsonComponent @JsonComponent}
+ * annotated beans.
  *
  * @author Phillip Webb
  * @author Paul Aly
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java
index 27f4afe181..569d9204fa 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java
@@ -199,8 +199,8 @@ public class AnnotationConfigReactiveWebApplicationContext extends AnnotationCon
 	 * If not set, the implementation may use a default as appropriate.
 	 * @param location the config location
 	 * @deprecated since 2.2.0 since this class no longer extends
-	 * {@code AbstractRefreshableConfigApplicationContext}. Use {@link ImportResource}
-	 * instead.
+	 * {@code AbstractRefreshableConfigApplicationContext}. Use
+	 * {@link ImportResource @ImportResource} instead.
 	 */
 	@Deprecated
 	public void setConfigLocation(String location) {
@@ -213,8 +213,8 @@ public class AnnotationConfigReactiveWebApplicationContext extends AnnotationCon
 	 * If not set, the implementation may use a default as appropriate.
 	 * @param locations the config locations
 	 * @deprecated since 2.2.0 since this class no longer extends
-	 * {@code AbstractRefreshableConfigApplicationContext}. Use {@link ImportResource}
-	 * instead.
+	 * {@code AbstractRefreshableConfigApplicationContext}. Use
+	 * {@link ImportResource @ImportResource} instead.
 	 */
 	@Deprecated
 	public void setConfigLocations(@Nullable String... locations) {
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrar.java
index 32da4a6748..6b6fa26ca5 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrar.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrar.java
@@ -30,7 +30,8 @@ import org.springframework.core.type.AnnotationMetadata;
 import org.springframework.util.ClassUtils;
 
 /**
- * {@link ImportBeanDefinitionRegistrar} used by {@link ServletComponentScan}.
+ * {@link ImportBeanDefinitionRegistrar} used by
+ * {@link ServletComponentScan @ServletComponentScan}.
  *
  * @author Andy Wilkinson
  * @author Stephane Nicoll
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java
index 898da4ed98..b62a162eec 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.ScannedGenericBeanDefinition;
 import org.springframework.util.StringUtils;
 
 /**
- * Handler for {@link WebFilter}-annotated classes.
+ * Handler for {@link WebFilter @WebFilter}-annotated classes.
  *
  * @author Andy Wilkinson
  */
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java
index 96451eb9be..3c2bebef1b 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java
@@ -25,7 +25,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
 import org.springframework.context.annotation.ScannedGenericBeanDefinition;
 
 /**
- * Handler for {@link WebListener}-annotated classes.
+ * Handler for {@link WebListener @WebListener}-annotated classes.
  *
  * @author Andy Wilkinson
  */
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java
index 71cc4bc5e1..2be5f4f591 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java
@@ -29,7 +29,7 @@ import org.springframework.context.annotation.ScannedGenericBeanDefinition;
 import org.springframework.util.StringUtils;
 
 /**
- * Handler for {@link WebServlet}-annotated classes.
+ * Handler for {@link WebServlet @WebServlet}-annotated classes.
  *
  * @author Andy Wilkinson
  */
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/ErrorAttributes.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/ErrorAttributes.java
index 0bc732f965..7b6e5a8da4 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/ErrorAttributes.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/error/ErrorAttributes.java
@@ -33,7 +33,8 @@ public interface ErrorAttributes {
 
 	/**
 	 * Returns a {@link Map} of the error attributes. The map can be used as the model of
-	 * an error page {@link ModelAndView}, or returned as a {@link ResponseBody}.
+	 * an error page {@link ModelAndView}, or returned as a
+	 * {@link ResponseBody @ResponseBody}.
 	 * @param webRequest the source request
 	 * @param includeStackTrace if stack trace elements should be included
 	 * @return a map of error attributes
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java
index 6020b26562..53b37279be 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java
@@ -31,7 +31,7 @@ import static org.mockito.BDDMockito.given;
 import static org.mockito.BDDMockito.willCallRealMethod;
 
 /**
- * Integration tests for {@link ConfigurationPropertiesScan}.
+ * Integration tests for {@link ConfigurationPropertiesScan @ConfigurationPropertiesScan}.
  *
  * @author Madhura Bhave
  * @author Johnny Lim
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java
index 7141686c71..7be1d75e9b 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java
@@ -92,8 +92,8 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
 /**
- * Tests for {@link ConfigurationProperties} annotated beans. Covers
- * {@link EnableConfigurationProperties},
+ * Tests for {@link ConfigurationProperties @ConfigurationProperties}-annotated beans.
+ * Covers {@link EnableConfigurationProperties @EnableConfigurationProperties},
  * {@link ConfigurationPropertiesBindingPostProcessorRegistrar},
  * {@link ConfigurationPropertiesBindingPostProcessor} and
  * {@link ConfigurationPropertiesBinder}.
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/ConfigurationPropertiesScanConfiguration.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/ConfigurationPropertiesScanConfiguration.java
index 6aeef3b142..70affd8e22 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/ConfigurationPropertiesScanConfiguration.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/ConfigurationPropertiesScanConfiguration.java
@@ -21,7 +21,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
 import org.springframework.boot.context.properties.scan.valid.b.BScanConfiguration;
 
 /**
- * Used for testing {@link ConfigurationProperties} scanning.
+ * Used for testing {@link ConfigurationProperties @ConfigurationProperties} scanning.
  *
  * @author Madhura Bhave
  */
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDataSizeTypeDescriptor.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDataSizeTypeDescriptor.java
index 5008c0860f..d5b0d2c231 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDataSizeTypeDescriptor.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDataSizeTypeDescriptor.java
@@ -27,7 +27,8 @@ import static org.mockito.BDDMockito.given;
 import static org.mockito.Mockito.mock;
 
 /**
- * Create a mock {@link TypeDescriptor} with optional {@link DataSizeUnit} annotation.
+ * Create a mock {@link TypeDescriptor} with optional {@link DataSizeUnit @DataSizeUnit}
+ * annotation.
  *
  * @author Stephane Nicoll
  */
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDurationTypeDescriptor.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDurationTypeDescriptor.java
index f8d8d65dd9..41abeac07c 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDurationTypeDescriptor.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDurationTypeDescriptor.java
@@ -27,8 +27,8 @@ import static org.mockito.BDDMockito.given;
 import static org.mockito.Mockito.mock;
 
 /**
- * Create a mock {@link TypeDescriptor} with optional {@link DurationUnit} and
- * {@link DurationFormat} annotations.
+ * Create a mock {@link TypeDescriptor} with optional {@link DurationUnit @DurationUnit}
+ * and {@link DurationFormat @DurationFormat} annotations.
  *
  * @author Phillip Webb
  */
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonComponent.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonComponent.java
index d3555a9429..c1575a8b5c 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonComponent.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonComponent.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 /**
- * Sample {@link JsonComponent} used for tests.
+ * Sample {@link JsonComponent @JsonComponent} used for tests.
  *
  * @author Phillip Webb
  */
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonKeyComponent.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonKeyComponent.java
index 31c2a6601e..b49e637633 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonKeyComponent.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonKeyComponent.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.KeyDeserializer;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 /**
- * Sample {@link JsonComponent} used for tests.
+ * Sample {@link JsonComponent @JsonComponent} used for tests.
  *
  * @author Paul Aly
  */
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndCareerJsonComponent.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndCareerJsonComponent.java
index 5c94e25edf..4ea1914e1e 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndCareerJsonComponent.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndCareerJsonComponent.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 /**
- * Sample {@link JsonComponent} used for tests.
+ * Sample {@link JsonComponent @JsonComponent} used for tests.
  *
  * @author Paul Aly
  */
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/LocalServerPortTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/LocalServerPortTests.java
index a6f6d1e6c4..da6fd5c2cc 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/LocalServerPortTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/LocalServerPortTests.java
@@ -27,7 +27,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
 import static org.assertj.core.api.Assertions.assertThat;
 
 /**
- * Tests for {@link LocalServerPort}.
+ * Tests for {@link LocalServerPort @LocalServerPort}.
  *
  * @author Anand Shah
  * @author Phillip Webb
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java
index 6201f4818e..60e6ae52e7 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java
@@ -34,7 +34,7 @@ import org.springframework.web.client.RestTemplate;
 import static org.assertj.core.api.Assertions.assertThat;
 
 /**
- * Integration tests for {@link ServletComponentScan}
+ * Integration tests for {@link ServletComponentScan @ServletComponentScan}
  *
  * @author Andy Wilkinson
  */