Commit 28166354 authored by Andy Wilkinson's avatar Andy Wilkinson

Polish

parent 4b2a116f
...@@ -39,6 +39,7 @@ class ShutdownEndpointAutoConfigurationTests { ...@@ -39,6 +39,7 @@ class ShutdownEndpointAutoConfigurationTests {
.withConfiguration(AutoConfigurations.of(ShutdownEndpointAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ShutdownEndpointAutoConfiguration.class));
@Test @Test
@SuppressWarnings("unchecked")
void runShouldHaveEndpointBeanThatIsNotDisposable() { void runShouldHaveEndpointBeanThatIsNotDisposable() {
this.contextRunner.withPropertyValues("management.endpoint.shutdown.enabled:true") this.contextRunner.withPropertyValues("management.endpoint.shutdown.enabled:true")
.withPropertyValues("management.endpoints.web.exposure.include=shutdown").run((context) -> { .withPropertyValues("management.endpoints.web.exposure.include=shutdown").run((context) -> {
......
...@@ -23,7 +23,6 @@ import java.util.Collections; ...@@ -23,7 +23,6 @@ import java.util.Collections;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; 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.OperationType;
import org.springframework.boot.actuate.endpoint.annotation.DiscoveredOperationMethod; import org.springframework.boot.actuate.endpoint.annotation.DiscoveredOperationMethod;
import org.springframework.boot.actuate.endpoint.annotation.Selector; import org.springframework.boot.actuate.endpoint.annotation.Selector;
...@@ -51,8 +50,7 @@ class RequestPredicateFactory { ...@@ -51,8 +50,7 @@ class RequestPredicateFactory {
this.endpointMediaTypes = endpointMediaTypes; this.endpointMediaTypes = endpointMediaTypes;
} }
WebOperationRequestPredicate getRequestPredicate(EndpointId endpointId, String rootPath, WebOperationRequestPredicate getRequestPredicate(String rootPath, DiscoveredOperationMethod operationMethod) {
DiscoveredOperationMethod operationMethod) {
Method method = operationMethod.getMethod(); Method method = operationMethod.getMethod();
String path = getPath(rootPath, method); String path = getPath(rootPath, method);
WebEndpointHttpMethod httpMethod = determineHttpMethod(operationMethod.getOperationType()); WebEndpointHttpMethod httpMethod = determineHttpMethod(operationMethod.getOperationType());
......
...@@ -76,8 +76,8 @@ public class WebEndpointDiscoverer extends EndpointDiscoverer<ExposableWebEndpoi ...@@ -76,8 +76,8 @@ public class WebEndpointDiscoverer extends EndpointDiscoverer<ExposableWebEndpoi
protected WebOperation createOperation(EndpointId endpointId, DiscoveredOperationMethod operationMethod, protected WebOperation createOperation(EndpointId endpointId, DiscoveredOperationMethod operationMethod,
OperationInvoker invoker) { OperationInvoker invoker) {
String rootPath = PathMapper.getRootPath(this.endpointPathMappers, endpointId); String rootPath = PathMapper.getRootPath(this.endpointPathMappers, endpointId);
WebOperationRequestPredicate requestPredicate = this.requestPredicateFactory.getRequestPredicate(endpointId, WebOperationRequestPredicate requestPredicate = this.requestPredicateFactory.getRequestPredicate(rootPath,
rootPath, operationMethod); operationMethod);
return new DiscoveredWebOperation(endpointId, operationMethod, invoker, requestPredicate); return new DiscoveredWebOperation(endpointId, operationMethod, invoker, requestPredicate);
} }
......
...@@ -66,7 +66,7 @@ public class RedisHealthIndicator extends AbstractHealthIndicator { ...@@ -66,7 +66,7 @@ public class RedisHealthIndicator extends AbstractHealthIndicator {
} }
} }
finally { finally {
RedisConnectionUtils.releaseConnection(connection, this.redisConnectionFactory); RedisConnectionUtils.releaseConnection(connection, this.redisConnectionFactory, false);
} }
} }
......
...@@ -289,7 +289,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests { ...@@ -289,7 +289,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
Stream<WebFilter> filters = filterChain.getWebFilters().toStream(); Stream<WebFilter> filters = filterChain.getWebFilters().toStream();
AuthenticationWebFilter webFilter = (AuthenticationWebFilter) filters AuthenticationWebFilter webFilter = (AuthenticationWebFilter) filters
.filter((f) -> f instanceof AuthenticationWebFilter).findFirst().orElse(null); .filter((f) -> f instanceof AuthenticationWebFilter).findFirst().orElse(null);
ReactiveAuthenticationManagerResolver authenticationManagerResolver = (ReactiveAuthenticationManagerResolver) ReflectionTestUtils ReactiveAuthenticationManagerResolver<?> authenticationManagerResolver = (ReactiveAuthenticationManagerResolver<?>) ReflectionTestUtils
.getField(webFilter, "authenticationManagerResolver"); .getField(webFilter, "authenticationManagerResolver");
Object authenticationManager = authenticationManagerResolver.resolve(null).block(); Object authenticationManager = authenticationManagerResolver.resolve(null).block();
assertThat(authenticationManager).isInstanceOf(JwtReactiveAuthenticationManager.class); assertThat(authenticationManager).isInstanceOf(JwtReactiveAuthenticationManager.class);
...@@ -302,7 +302,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests { ...@@ -302,7 +302,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
Stream<WebFilter> filters = filterChain.getWebFilters().toStream(); Stream<WebFilter> filters = filterChain.getWebFilters().toStream();
AuthenticationWebFilter webFilter = (AuthenticationWebFilter) filters AuthenticationWebFilter webFilter = (AuthenticationWebFilter) filters
.filter((f) -> f instanceof AuthenticationWebFilter).findFirst().orElse(null); .filter((f) -> f instanceof AuthenticationWebFilter).findFirst().orElse(null);
ReactiveAuthenticationManagerResolver authenticationManagerResolver = (ReactiveAuthenticationManagerResolver) ReflectionTestUtils ReactiveAuthenticationManagerResolver<?> authenticationManagerResolver = (ReactiveAuthenticationManagerResolver<?>) ReflectionTestUtils
.getField(webFilter, "authenticationManagerResolver"); .getField(webFilter, "authenticationManagerResolver");
Object authenticationManager = authenticationManagerResolver.resolve(null).block(); Object authenticationManager = authenticationManagerResolver.resolve(null).block();
assertThat(authenticationManager).isInstanceOf(OAuth2IntrospectionReactiveAuthenticationManager.class); assertThat(authenticationManager).isInstanceOf(OAuth2IntrospectionReactiveAuthenticationManager.class);
......
...@@ -217,15 +217,15 @@ class ServerPropertiesTests { ...@@ -217,15 +217,15 @@ class ServerPropertiesTests {
@Test @Test
void testCustomizeUndertowServerOption() { void testCustomizeUndertowServerOption() {
bind("server.undertow.options.server.ALWAYS_SET_KEEP_ALIVE", "true"); 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()).containsEntry("ALWAYS_SET_KEEP_ALIVE",
assertThat(this.properties.getUndertow().getOptions().getServer().get("ALWAYS_SET_KEEP_ALIVE").equals("true")); "true");
} }
@Test @Test
void testCustomizeUndertowSocketOption() { void testCustomizeUndertowSocketOption() {
bind("server.undertow.options.socket.ALWAYS_SET_KEEP_ALIVE", "true"); 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()).containsEntry("ALWAYS_SET_KEEP_ALIVE",
assertThat(this.properties.getUndertow().getOptions().getSocket().get("ALWAYS_SET_KEEP_ALIVE").equals("true")); "true");
} }
@Test @Test
......
...@@ -28,6 +28,7 @@ import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory; ...@@ -28,6 +28,7 @@ import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory;
import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.http.server.reactive.HttpHandler; import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient;
...@@ -86,6 +87,7 @@ abstract class AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests { ...@@ -86,6 +87,7 @@ abstract class AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests {
assertThat(this.value).isEqualTo(123); assertThat(this.value).isEqualTo(123);
} }
@Configuration(proxyBeanMethods = false)
static class AbstractConfig { static class AbstractConfig {
@Value("${server.port:8080}") @Value("${server.port:8080}")
......
...@@ -27,6 +27,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactor ...@@ -27,6 +27,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactor
import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
...@@ -91,6 +92,7 @@ abstract class AbstractSpringBootTestWebServerWebEnvironmentTests { ...@@ -91,6 +92,7 @@ abstract class AbstractSpringBootTestWebServerWebEnvironmentTests {
assertThat(this.context).isSameAs(WebApplicationContextUtils.getWebApplicationContext(this.servletContext)); assertThat(this.context).isSameAs(WebApplicationContextUtils.getWebApplicationContext(this.servletContext));
} }
@Configuration(proxyBeanMethods = false)
static class AbstractConfig { static class AbstractConfig {
@Value("${server.port:8080}") @Value("${server.port:8080}")
......
...@@ -20,6 +20,7 @@ import java.util.Arrays; ...@@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.Extension; import org.junit.jupiter.api.extension.Extension;
import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.TestTemplateInvocationContext; import org.junit.jupiter.api.extension.TestTemplateInvocationContext;
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -31,16 +31,10 @@ public enum Dsl { ...@@ -31,16 +31,10 @@ public enum Dsl {
this.extension = extension; this.extension = extension;
} }
/**
* Gets the user-friendly name of the DSL
*/
public String getName() { public String getName() {
return this.name; return this.name;
} }
/**
* Gets the file extension of build scripts (starting with a dot)
*/
String getExtension() { String getExtension() {
return this.extension; return this.extension;
} }
......
...@@ -22,6 +22,7 @@ import java.util.regex.Pattern; ...@@ -22,6 +22,7 @@ import java.util.regex.Pattern;
import org.junit.jupiter.api.extension.AfterEachCallback; import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback; import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.Extension;
import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ExtensionContext;
import org.springframework.util.ReflectionUtils; import org.springframework.util.ReflectionUtils;
......
...@@ -418,12 +418,14 @@ public class PropertiesLauncher extends Launcher { ...@@ -418,12 +418,14 @@ public class PropertiesLauncher extends Launcher {
try { try {
if (this.home != null) { if (this.home != null) {
// Prefer home dir for MANIFEST if there is one // Prefer home dir for MANIFEST if there is one
Manifest manifest = new ExplodedArchive(this.home, false).getManifest(); try (ExplodedArchive archive = new ExplodedArchive(this.home, false)) {
if (manifest != null) { Manifest manifest = archive.getManifest();
String value = manifest.getMainAttributes().getValue(manifestKey); if (manifest != null) {
if (value != null) { String value = manifest.getMainAttributes().getValue(manifestKey);
debug("Property '" + manifestKey + "' from home directory manifest: " + value); if (value != null) {
return SystemPropertyUtils.resolvePlaceholders(this.properties, value); debug("Property '" + manifestKey + "' from home directory manifest: " + value);
return SystemPropertyUtils.resolvePlaceholders(this.properties, value);
}
} }
} }
} }
......
...@@ -27,6 +27,7 @@ import java.util.UUID; ...@@ -27,6 +27,7 @@ import java.util.UUID;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.jar.JarFile; import java.util.jar.JarFile;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.api.io.TempDir;
...@@ -59,6 +60,13 @@ class ExplodedArchiveTests { ...@@ -59,6 +60,13 @@ class ExplodedArchiveTests {
createArchive(); createArchive();
} }
@AfterEach
void tearDown() throws Exception {
if (this.archive != null) {
this.archive.close();
}
}
private void createArchive() throws Exception { private void createArchive() throws Exception {
createArchive(null); createArchive(null);
} }
...@@ -126,44 +134,49 @@ class ExplodedArchiveTests { ...@@ -126,44 +134,49 @@ class ExplodedArchiveTests {
} }
@Test @Test
void getNonRecursiveEntriesForRoot() { void getNonRecursiveEntriesForRoot() throws Exception {
ExplodedArchive archive = new ExplodedArchive(new File("/"), false); try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("/"), false)) {
Map<String, Archive.Entry> entries = getEntriesMap(archive); Map<String, Archive.Entry> entries = getEntriesMap(explodedArchive);
assertThat(entries.size()).isGreaterThan(1); assertThat(entries.size()).isGreaterThan(1);
}
} }
@Test @Test
void getNonRecursiveManifest() throws Exception { void getNonRecursiveManifest() throws Exception {
ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root")); try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"))) {
assertThat(archive.getManifest()).isNotNull(); assertThat(explodedArchive.getManifest()).isNotNull();
Map<String, Archive.Entry> entries = getEntriesMap(archive); Map<String, Archive.Entry> entries = getEntriesMap(explodedArchive);
assertThat(entries.size()).isEqualTo(4); assertThat(entries.size()).isEqualTo(4);
}
} }
@Test @Test
void getNonRecursiveManifestEvenIfNonRecursive() throws Exception { void getNonRecursiveManifestEvenIfNonRecursive() throws Exception {
ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root"), false); try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"), false)) {
assertThat(archive.getManifest()).isNotNull(); assertThat(this.archive.getManifest()).isNotNull();
Map<String, Archive.Entry> entries = getEntriesMap(archive); Map<String, Archive.Entry> entries = getEntriesMap(this.archive);
assertThat(entries.size()).isEqualTo(3); assertThat(entries.size()).isEqualTo(3);
}
} }
@Test @Test
void getResourceAsStream() throws Exception { void getResourceAsStream() throws Exception {
ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root")); try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"))) {
assertThat(archive.getManifest()).isNotNull(); assertThat(explodedArchive.getManifest()).isNotNull();
URLClassLoader loader = new URLClassLoader(new URL[] { archive.getUrl() }); URLClassLoader loader = new URLClassLoader(new URL[] { explodedArchive.getUrl() });
assertThat(loader.getResourceAsStream("META-INF/spring/application.xml")).isNotNull(); assertThat(loader.getResourceAsStream("META-INF/spring/application.xml")).isNotNull();
loader.close(); loader.close();
}
} }
@Test @Test
void getResourceAsStreamNonRecursive() throws Exception { void getResourceAsStreamNonRecursive() throws Exception {
ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root"), false); try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"), false)) {
assertThat(archive.getManifest()).isNotNull(); assertThat(explodedArchive.getManifest()).isNotNull();
URLClassLoader loader = new URLClassLoader(new URL[] { archive.getUrl() }); URLClassLoader loader = new URLClassLoader(new URL[] { explodedArchive.getUrl() });
assertThat(loader.getResourceAsStream("META-INF/spring/application.xml")).isNotNull(); assertThat(loader.getResourceAsStream("META-INF/spring/application.xml")).isNotNull();
loader.close(); loader.close();
}
} }
private Map<String, Archive.Entry> getEntriesMap(Archive archive) { private Map<String, Archive.Entry> getEntriesMap(Archive archive) {
......
/*
* 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;
...@@ -27,8 +27,9 @@ import org.springframework.core.annotation.AnnotationUtils; ...@@ -27,8 +27,9 @@ import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
/** /**
* {@link BeanDefinition} that is used for registering {@link ConfigurationProperties} * {@link BeanDefinition} that is used for registering
* beans that are bound at creation time. * {@link ConfigurationProperties @ConfigurationProperties} beans that are bound at
* creation time.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Madhura Bhave * @author Madhura Bhave
......
...@@ -34,8 +34,9 @@ import org.springframework.util.Assert; ...@@ -34,8 +34,9 @@ import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**
* Registers a bean definition for a type annotated with {@link ConfigurationProperties} * Registers a bean definition for a type annotated with
* using the prefix of the annotation in the bean name. * {@link ConfigurationProperties @ConfigurationProperties} using the prefix of the
* annotation in the bean name.
* *
* @author Madhura Bhave * @author Madhura Bhave
*/ */
......
...@@ -46,7 +46,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -46,7 +46,7 @@ import org.springframework.validation.annotation.Validated;
/** /**
* Internal class by the {@link ConfigurationPropertiesBindingPostProcessor} to handle the * Internal class by the {@link ConfigurationPropertiesBindingPostProcessor} to handle the
* actual {@link ConfigurationProperties} binding. * actual {@link ConfigurationProperties @ConfigurationProperties} binding.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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; ...@@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
/** /**
* Qualifier for beans that are needed to configure the binding of * 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 * @author Dave Syer
* @since 1.3.0 * @since 1.3.0
......
...@@ -36,7 +36,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -36,7 +36,7 @@ import org.springframework.validation.annotation.Validated;
/** /**
* {@link BeanPostProcessor} to bind {@link PropertySources} to beans annotated with * {@link BeanPostProcessor} to bind {@link PropertySources} to beans annotated with
* {@link ConfigurationProperties}. * {@link ConfigurationProperties @ConfigurationProperties}.
* *
* @author Dave Syer * @author Dave Syer
* @author Phillip Webb * @author Phillip Webb
......
...@@ -24,7 +24,7 @@ import org.springframework.core.type.AnnotationMetadata; ...@@ -24,7 +24,7 @@ import org.springframework.core.type.AnnotationMetadata;
/** /**
* {@link ImportBeanDefinitionRegistrar} for binding externalized application properties * {@link ImportBeanDefinitionRegistrar} for binding externalized application properties
* to {@link ConfigurationProperties} beans. * to {@link ConfigurationProperties @ConfigurationProperties} beans.
* *
* @author Dave Syer * @author Dave Syer
* @author Phillip Webb * @author Phillip Webb
......
...@@ -25,11 +25,11 @@ import org.springframework.context.annotation.Import; ...@@ -25,11 +25,11 @@ import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AliasFor; import org.springframework.core.annotation.AliasFor;
/** /**
* Configures the base packages used when scanning for {@link ConfigurationProperties} * Configures the base packages used when scanning for
* classes. One of {@link #basePackageClasses()}, {@link #basePackages()} or its alias * {@link ConfigurationProperties @ConfigurationProperties} classes. One of
* {@link #value()} may be specified to define specific packages to scan. If specific * {@link #basePackageClasses()}, {@link #basePackages()} or its alias {@link #value()}
* packages are not defined scanning will occur from the package of the class with this * may be specified to define specific packages to scan. If specific packages are not
* annotation. * defined scanning will occur from the package of the class with this annotation.
* *
* @author Madhura Bhave * @author Madhura Bhave
* @since 2.2.0 * @since 2.2.0
......
...@@ -38,8 +38,8 @@ import org.springframework.util.ClassUtils; ...@@ -38,8 +38,8 @@ import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**
* {@link ImportBeanDefinitionRegistrar} for registering {@link ConfigurationProperties} * {@link ImportBeanDefinitionRegistrar} for registering
* bean definitions via scanning. * {@link ConfigurationProperties @ConfigurationProperties} bean definitions via scanning.
* *
* @author Madhura Bhave * @author Madhura Bhave
*/ */
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -23,9 +23,10 @@ import java.lang.annotation.RetentionPolicy; ...@@ -23,9 +23,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* Indicates that a getter in a {@link ConfigurationProperties} object is deprecated. This * Indicates that a getter in a {@link ConfigurationProperties @ConfigurationProperties}
* annotation has no bearing on the actual binding processes, but it is used by the * object is deprecated. This annotation has no bearing on the actual binding processes,
* {@code spring-boot-configuration-processor} to add deprecation meta-data. * but it is used by the {@code spring-boot-configuration-processor} to add deprecation
* meta-data.
* <p> * <p>
* This annotation <strong>must</strong> be used on the getter of the deprecated element. * This annotation <strong>must</strong> be used on the getter of the deprecated element.
* *
......
...@@ -26,9 +26,9 @@ import org.springframework.context.annotation.Bean; ...@@ -26,9 +26,9 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
/** /**
* Enable support for {@link ConfigurationProperties} annotated beans. * Enable support for {@link ConfigurationProperties @ConfigurationProperties} annotated
* {@link ConfigurationProperties} beans can be registered in the standard way (for * beans. {@code @ConfigurationProperties} beans can be registered in the standard way
* example using {@link Bean @Bean} methods) or, for convenience, can be specified * (for example using {@link Bean @Bean} methods) or, for convenience, can be specified
* directly on this annotation. * directly on this annotation.
* *
* @author Dave Syer * @author Dave Syer
...@@ -41,9 +41,10 @@ import org.springframework.context.annotation.Import; ...@@ -41,9 +41,10 @@ import org.springframework.context.annotation.Import;
public @interface EnableConfigurationProperties { public @interface EnableConfigurationProperties {
/** /**
* Convenient way to quickly register {@link ConfigurationProperties} annotated beans * Convenient way to quickly register
* with Spring. Standard Spring Beans will also be scanned regardless of this value. * {@link ConfigurationProperties @ConfigurationProperties} annotated beans with
* @return {@link ConfigurationProperties} annotated beans to register * Spring. Standard Spring Beans will also be scanned regardless of this value.
* @return {@code @ConfigurationProperties} annotated beans to register
*/ */
Class<?>[] value() default {}; Class<?>[] value() default {};
......
...@@ -19,7 +19,8 @@ package org.springframework.boot.context.properties; ...@@ -19,7 +19,8 @@ package org.springframework.boot.context.properties;
import org.springframework.util.Assert; 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 * @author Madhura Bhave
* @since 2.2.0 * @since 2.2.0
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -23,11 +23,12 @@ import java.lang.annotation.RetentionPolicy; ...@@ -23,11 +23,12 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* Indicates that a field in a {@link ConfigurationProperties} object should be treated as * Indicates that a field in a {@link ConfigurationProperties @ConfigurationProperties}
* if it were a nested type. This annotation has no bearing on the actual binding * object should be treated as if it were a nested type. This annotation has no bearing on
* processes, but it is used by the {@code spring-boot-configuration-processor} as a hint * the actual binding processes, but it is used by the
* that a field is not bound as a single value. When this is specified, a nested group is * {@code spring-boot-configuration-processor} as a hint that a field is not bound as a
* created for the field and its type is harvested. * single value. When this is specified, a nested group is created for the field and its
* type is harvested.
* <p> * <p>
* This has no effect on collections and maps as these types are automatically identified. * This has no effect on collections and maps as these types are automatically identified.
* *
......
...@@ -30,10 +30,11 @@ import org.springframework.core.annotation.AliasFor; ...@@ -30,10 +30,11 @@ import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* {@link Component} that provides {@link JsonSerializer}, {@link JsonDeserializer} or * {@link Component @Component} that provides {@link JsonSerializer},
* {@link KeyDeserializer} implementations to be registered with Jackson when * {@link JsonDeserializer} or {@link KeyDeserializer} implementations to be registered
* {@link JsonComponentModule} is in use. Can be used to annotate implementations directly * with Jackson when {@link JsonComponentModule} is in use. Can be used to annotate
* or a class that contains them as inner-classes. For example: <pre class="code"> * implementations directly or a class that contains them as inner-classes. For example:
* <pre class="code">
* &#064;JsonComponent * &#064;JsonComponent
* public class CustomerJsonComponent { * public class CustomerJsonComponent {
* *
......
...@@ -43,8 +43,8 @@ import org.springframework.util.Assert; ...@@ -43,8 +43,8 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
/** /**
* Spring Bean and Jackson {@link Module} to register {@link JsonComponent} annotated * Spring Bean and Jackson {@link Module} to register {@link JsonComponent @JsonComponent}
* beans. * annotated beans.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Paul Aly * @author Paul Aly
......
...@@ -199,8 +199,8 @@ public class AnnotationConfigReactiveWebApplicationContext extends AnnotationCon ...@@ -199,8 +199,8 @@ public class AnnotationConfigReactiveWebApplicationContext extends AnnotationCon
* If not set, the implementation may use a default as appropriate. * If not set, the implementation may use a default as appropriate.
* @param location the config location * @param location the config location
* @deprecated since 2.2.0 since this class no longer extends * @deprecated since 2.2.0 since this class no longer extends
* {@code AbstractRefreshableConfigApplicationContext}. Use {@link ImportResource} * {@code AbstractRefreshableConfigApplicationContext}. Use
* instead. * {@link ImportResource @ImportResource} instead.
*/ */
@Deprecated @Deprecated
public void setConfigLocation(String location) { public void setConfigLocation(String location) {
...@@ -213,8 +213,8 @@ public class AnnotationConfigReactiveWebApplicationContext extends AnnotationCon ...@@ -213,8 +213,8 @@ public class AnnotationConfigReactiveWebApplicationContext extends AnnotationCon
* If not set, the implementation may use a default as appropriate. * If not set, the implementation may use a default as appropriate.
* @param locations the config locations * @param locations the config locations
* @deprecated since 2.2.0 since this class no longer extends * @deprecated since 2.2.0 since this class no longer extends
* {@code AbstractRefreshableConfigApplicationContext}. Use {@link ImportResource} * {@code AbstractRefreshableConfigApplicationContext}. Use
* instead. * {@link ImportResource @ImportResource} instead.
*/ */
@Deprecated @Deprecated
public void setConfigLocations(@Nullable String... locations) { public void setConfigLocations(@Nullable String... locations) {
......
...@@ -30,7 +30,8 @@ import org.springframework.core.type.AnnotationMetadata; ...@@ -30,7 +30,8 @@ import org.springframework.core.type.AnnotationMetadata;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
/** /**
* {@link ImportBeanDefinitionRegistrar} used by {@link ServletComponentScan}. * {@link ImportBeanDefinitionRegistrar} used by
* {@link ServletComponentScan @ServletComponentScan}.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Stephane Nicoll * @author Stephane Nicoll
......
...@@ -30,7 +30,7 @@ import org.springframework.context.annotation.ScannedGenericBeanDefinition; ...@@ -30,7 +30,7 @@ import org.springframework.context.annotation.ScannedGenericBeanDefinition;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**
* Handler for {@link WebFilter}-annotated classes. * Handler for {@link WebFilter @WebFilter}-annotated classes.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
......
...@@ -25,7 +25,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; ...@@ -25,7 +25,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ScannedGenericBeanDefinition; import org.springframework.context.annotation.ScannedGenericBeanDefinition;
/** /**
* Handler for {@link WebListener}-annotated classes. * Handler for {@link WebListener @WebListener}-annotated classes.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
......
...@@ -29,7 +29,7 @@ import org.springframework.context.annotation.ScannedGenericBeanDefinition; ...@@ -29,7 +29,7 @@ import org.springframework.context.annotation.ScannedGenericBeanDefinition;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**
* Handler for {@link WebServlet}-annotated classes. * Handler for {@link WebServlet @WebServlet}-annotated classes.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
......
...@@ -33,7 +33,8 @@ public interface ErrorAttributes { ...@@ -33,7 +33,8 @@ public interface ErrorAttributes {
/** /**
* Returns a {@link Map} of the error attributes. The map can be used as the model of * 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 webRequest the source request
* @param includeStackTrace if stack trace elements should be included * @param includeStackTrace if stack trace elements should be included
* @return a map of error attributes * @return a map of error attributes
......
...@@ -31,7 +31,7 @@ import static org.mockito.BDDMockito.given; ...@@ -31,7 +31,7 @@ import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willCallRealMethod; import static org.mockito.BDDMockito.willCallRealMethod;
/** /**
* Integration tests for {@link ConfigurationPropertiesScan}. * Integration tests for {@link ConfigurationPropertiesScan @ConfigurationPropertiesScan}.
* *
* @author Madhura Bhave * @author Madhura Bhave
* @author Johnny Lim * @author Johnny Lim
......
...@@ -92,8 +92,8 @@ import static org.mockito.Mockito.mock; ...@@ -92,8 +92,8 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
/** /**
* Tests for {@link ConfigurationProperties} annotated beans. Covers * Tests for {@link ConfigurationProperties @ConfigurationProperties}-annotated beans.
* {@link EnableConfigurationProperties}, * Covers {@link EnableConfigurationProperties @EnableConfigurationProperties},
* {@link ConfigurationPropertiesBindingPostProcessorRegistrar}, * {@link ConfigurationPropertiesBindingPostProcessorRegistrar},
* {@link ConfigurationPropertiesBindingPostProcessor} and * {@link ConfigurationPropertiesBindingPostProcessor} and
* {@link ConfigurationPropertiesBinder}. * {@link ConfigurationPropertiesBinder}.
......
...@@ -21,7 +21,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties ...@@ -21,7 +21,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.context.properties.scan.valid.b.BScanConfiguration; 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 * @author Madhura Bhave
*/ */
......
...@@ -27,7 +27,8 @@ import static org.mockito.BDDMockito.given; ...@@ -27,7 +27,8 @@ import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock; 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 * @author Stephane Nicoll
*/ */
......
...@@ -27,8 +27,8 @@ import static org.mockito.BDDMockito.given; ...@@ -27,8 +27,8 @@ import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Create a mock {@link TypeDescriptor} with optional {@link DurationUnit} and * Create a mock {@link TypeDescriptor} with optional {@link DurationUnit @DurationUnit}
* {@link DurationFormat} annotations. * and {@link DurationFormat @DurationFormat} annotations.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
......
...@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode; ...@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.SerializerProvider;
/** /**
* Sample {@link JsonComponent} used for tests. * Sample {@link JsonComponent @JsonComponent} used for tests.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.KeyDeserializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.KeyDeserializer;
import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.SerializerProvider;
/** /**
* Sample {@link JsonComponent} used for tests. * Sample {@link JsonComponent @JsonComponent} used for tests.
* *
* @author Paul Aly * @author Paul Aly
*/ */
......
...@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode; ...@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.SerializerProvider;
/** /**
* Sample {@link JsonComponent} used for tests. * Sample {@link JsonComponent @JsonComponent} used for tests.
* *
* @author Paul Aly * @author Paul Aly
*/ */
......
...@@ -27,7 +27,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; ...@@ -27,7 +27,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link LocalServerPort}. * Tests for {@link LocalServerPort @LocalServerPort}.
* *
* @author Anand Shah * @author Anand Shah
* @author Phillip Webb * @author Phillip Webb
......
...@@ -34,7 +34,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -34,7 +34,7 @@ import org.springframework.web.client.RestTemplate;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Integration tests for {@link ServletComponentScan} * Integration tests for {@link ServletComponentScan @ServletComponentScan}
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment