Polish
This commit is contained in:
@@ -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) -> {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -76,8 +76,8 @@ public class WebEndpointDiscoverer extends EndpointDiscoverer<ExposableWebEndpoi
|
||||
protected WebOperation createOperation(EndpointId endpointId, DiscoveredOperationMethod operationMethod,
|
||||
OperationInvoker invoker) {
|
||||
String rootPath = PathMapper.getRootPath(this.endpointPathMappers, endpointId);
|
||||
WebOperationRequestPredicate requestPredicate = this.requestPredicateFactory.getRequestPredicate(endpointId,
|
||||
rootPath, operationMethod);
|
||||
WebOperationRequestPredicate requestPredicate = this.requestPredicateFactory.getRequestPredicate(rootPath,
|
||||
operationMethod);
|
||||
return new DiscoveredWebOperation(endpointId, operationMethod, invoker, requestPredicate);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public class RedisHealthIndicator extends AbstractHealthIndicator {
|
||||
}
|
||||
}
|
||||
finally {
|
||||
RedisConnectionUtils.releaseConnection(connection, this.redisConnectionFactory);
|
||||
RedisConnectionUtils.releaseConnection(connection, this.redisConnectionFactory, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests {
|
||||
Stream<WebFilter> 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<WebFilter> 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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<String, Archive.Entry> entries = getEntriesMap(archive);
|
||||
assertThat(entries.size()).isGreaterThan(1);
|
||||
void getNonRecursiveEntriesForRoot() throws Exception {
|
||||
try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("/"), false)) {
|
||||
Map<String, Archive.Entry> 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<String, Archive.Entry> entries = getEntriesMap(archive);
|
||||
assertThat(entries.size()).isEqualTo(4);
|
||||
try (ExplodedArchive explodedArchive = new ExplodedArchive(new File("src/test/resources/root"))) {
|
||||
assertThat(explodedArchive.getManifest()).isNotNull();
|
||||
Map<String, Archive.Entry> 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<String, Archive.Entry> 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<String, Archive.Entry> 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<String, Archive.Entry> getEntriesMap(Archive archive) {
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
* <p>
|
||||
* This annotation <strong>must</strong> be used on the getter of the deprecated element.
|
||||
*
|
||||
|
||||
@@ -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 {};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
* <p>
|
||||
* This has no effect on collections and maps as these types are automatically identified.
|
||||
*
|
||||
|
||||
@@ -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: <pre class="code">
|
||||
* {@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:
|
||||
* <pre class="code">
|
||||
* @JsonComponent
|
||||
* public class CustomerJsonComponent {
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}.
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user