Commit 7d34a58d authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #11448 from izeye:polish-20171230

* pr/11448:
  Polish
parents a46d1416 24b5a78e
...@@ -113,17 +113,15 @@ class OnEnabledEndpointCondition extends SpringBootCondition { ...@@ -113,17 +113,15 @@ class OnEnabledEndpointCondition extends SpringBootCondition {
protected AnnotationAttributes getEndpointAttributes(Class<?> type) { protected AnnotationAttributes getEndpointAttributes(Class<?> type) {
AnnotationAttributes attributes = AnnotatedElementUtils AnnotationAttributes attributes = AnnotatedElementUtils
.findMergedAnnotationAttributes(type, Endpoint.class, true, true); .findMergedAnnotationAttributes(type, Endpoint.class, true, true);
if (attributes == null) {
attributes = AnnotatedElementUtils.findMergedAnnotationAttributes(type,
EndpointExtension.class, false, true);
if (attributes != null) { if (attributes != null) {
return getEndpointAttributes(attributes.getClass("endpoint")); return attributes;
}
} }
attributes = AnnotatedElementUtils.findMergedAnnotationAttributes(type,
EndpointExtension.class, false, true);
Assert.state(attributes != null, Assert.state(attributes != null,
"OnEnabledEndpointCondition may only be used on @Bean methods that " "OnEnabledEndpointCondition may only be used on @Bean methods that "
+ "return an @Endpoint or and @EndpointExtension"); + "return an @Endpoint or @EndpointExtension");
return attributes; return getEndpointAttributes(attributes.getClass("endpoint"));
} }
} }
...@@ -20,7 +20,6 @@ import java.util.Map; ...@@ -20,7 +20,6 @@ import java.util.Map;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.health.HealthEndpointWebExtension; import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
import org.springframework.boot.actuate.health.HealthStatusHttpMapper; import org.springframework.boot.actuate.health.HealthStatusHttpMapper;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
...@@ -30,7 +29,7 @@ import org.springframework.test.util.ReflectionTestUtils; ...@@ -30,7 +29,7 @@ import org.springframework.test.util.ReflectionTestUtils;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link EndpointAutoConfiguration} in a servlet environment. * Tests for {@link HealthEndpointAutoConfiguration} in a servlet environment.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Stephane Nicoll * @author Stephane Nicoll
......
...@@ -25,10 +25,8 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAu ...@@ -25,10 +25,8 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAu
import org.springframework.boot.actuate.autoconfigure.endpoint.web.reactive.WebFluxEndpointManagementContextConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.web.reactive.WebFluxEndpointManagementContextConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.reactive.ReactiveManagementContextAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.web.reactive.ReactiveManagementContextAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
import org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration; import org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportMessage;
import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.test.util.TestPropertyValues;
...@@ -61,10 +59,8 @@ public class WebFluxEndpointCorsIntegrationTests { ...@@ -61,10 +59,8 @@ public class WebFluxEndpointCorsIntegrationTests {
@Test @Test
public void corsIsDisabledByDefault() { public void corsIsDisabledByDefault() {
WebTestClient client = createWebTestClient(); createWebTestClient()
System.out.println(new ConditionEvaluationReportMessage( .options().uri("/actuator/beans")
this.context.getBean(ConditionEvaluationReport.class)));
client.options().uri("/actuator/beans")
.header("Origin", "spring.example.org") .header("Origin", "spring.example.org")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET") .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET")
.exchange() .exchange()
......
...@@ -25,10 +25,8 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAu ...@@ -25,10 +25,8 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAu
import org.springframework.boot.actuate.autoconfigure.endpoint.web.servlet.WebMvcEndpointManagementContextConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.web.servlet.WebMvcEndpointManagementContextConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportMessage;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.test.util.TestPropertyValues;
...@@ -69,12 +67,10 @@ public class WebMvcEndpointCorsIntegrationTests { ...@@ -69,12 +67,10 @@ public class WebMvcEndpointCorsIntegrationTests {
@Test @Test
public void corsIsDisabledByDefault() throws Exception { public void corsIsDisabledByDefault() throws Exception {
MockMvc mockMvc = createMockMvc(); createMockMvc()
System.out.println(new ConditionEvaluationReportMessage( .perform(options("/actuator/beans").header("Origin", "foo.example.com")
this.context.getBean(ConditionEvaluationReport.class))); .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"))
mockMvc.perform(options("/actuator/beans").header("Origin", "foo.example.com") .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET")).andExpect(
header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
} }
@Test @Test
......
...@@ -274,7 +274,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -274,7 +274,7 @@ public class DefaultServletWebServerFactoryCustomizer
} }
private static void customizeAcceptCount(TomcatServletWebServerFactory factory, private static void customizeAcceptCount(TomcatServletWebServerFactory factory,
final int acceptCount) { int acceptCount) {
factory.addConnectorCustomizers((connector) -> { factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler(); ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractProtocol) { if (handler instanceof AbstractProtocol) {
...@@ -285,7 +285,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -285,7 +285,7 @@ public class DefaultServletWebServerFactoryCustomizer
} }
private static void customizeMaxConnections(TomcatServletWebServerFactory factory, private static void customizeMaxConnections(TomcatServletWebServerFactory factory,
final int maxConnections) { int maxConnections) {
factory.addConnectorCustomizers((connector) -> { factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler(); ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractProtocol) { if (handler instanceof AbstractProtocol) {
...@@ -332,7 +332,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -332,7 +332,7 @@ public class DefaultServletWebServerFactoryCustomizer
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
private static void customizeMaxThreads(TomcatServletWebServerFactory factory, private static void customizeMaxThreads(TomcatServletWebServerFactory factory,
final int maxThreads) { int maxThreads) {
factory.addConnectorCustomizers((connector) -> { factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler(); ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractProtocol) { if (handler instanceof AbstractProtocol) {
...@@ -344,7 +344,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -344,7 +344,7 @@ public class DefaultServletWebServerFactoryCustomizer
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
private static void customizeMinThreads(TomcatServletWebServerFactory factory, private static void customizeMinThreads(TomcatServletWebServerFactory factory,
final int minSpareThreads) { int minSpareThreads) {
factory.addConnectorCustomizers((connector) -> { factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler(); ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractProtocol) { if (handler instanceof AbstractProtocol) {
...@@ -356,7 +356,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -356,7 +356,7 @@ public class DefaultServletWebServerFactoryCustomizer
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
private static void customizeMaxHttpHeaderSize( private static void customizeMaxHttpHeaderSize(
TomcatServletWebServerFactory factory, final int maxHttpHeaderSize) { TomcatServletWebServerFactory factory, int maxHttpHeaderSize) {
factory.addConnectorCustomizers((connector) -> { factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler(); ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractHttp11Protocol) { if (handler instanceof AbstractHttp11Protocol) {
...@@ -367,7 +367,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -367,7 +367,7 @@ public class DefaultServletWebServerFactoryCustomizer
} }
private static void customizeMaxHttpPostSize( private static void customizeMaxHttpPostSize(
TomcatServletWebServerFactory factory, final int maxHttpPostSize) { TomcatServletWebServerFactory factory, int maxHttpPostSize) {
factory.addConnectorCustomizers( factory.addConnectorCustomizers(
(connector) -> connector.setMaxPostSize(maxHttpPostSize)); (connector) -> connector.setMaxPostSize(maxHttpPostSize));
} }
...@@ -391,14 +391,14 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -391,14 +391,14 @@ public class DefaultServletWebServerFactoryCustomizer
private static void customizeRedirectContextRoot( private static void customizeRedirectContextRoot(
TomcatServletWebServerFactory factory, TomcatServletWebServerFactory factory,
final boolean redirectContextRoot) { boolean redirectContextRoot) {
factory.addContextCustomizers((context) -> context factory.addContextCustomizers((context) -> context
.setMapperContextRootRedirectEnabled(redirectContextRoot)); .setMapperContextRootRedirectEnabled(redirectContextRoot));
} }
private static void customizeUseRelativeRedirects( private static void customizeUseRelativeRedirects(
TomcatServletWebServerFactory factory, TomcatServletWebServerFactory factory,
final boolean useRelativeRedirects) { boolean useRelativeRedirects) {
factory.addContextCustomizers( factory.addContextCustomizers(
(context) -> context.setUseRelativeRedirects(useRelativeRedirects)); (context) -> context.setUseRelativeRedirects(useRelativeRedirects));
} }
...@@ -474,13 +474,13 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -474,13 +474,13 @@ public class DefaultServletWebServerFactoryCustomizer
} }
private static void customizeMaxHttpHeaderSize( private static void customizeMaxHttpHeaderSize(
UndertowServletWebServerFactory factory, final int maxHttpHeaderSize) { UndertowServletWebServerFactory factory, int maxHttpHeaderSize) {
factory.addBuilderCustomizers((builder) -> builder factory.addBuilderCustomizers((builder) -> builder
.setServerOption(UndertowOptions.MAX_HEADER_SIZE, maxHttpHeaderSize)); .setServerOption(UndertowOptions.MAX_HEADER_SIZE, maxHttpHeaderSize));
} }
private static void customizeMaxHttpPostSize( private static void customizeMaxHttpPostSize(
UndertowServletWebServerFactory factory, final long maxHttpPostSize) { UndertowServletWebServerFactory factory, long maxHttpPostSize) {
factory.addBuilderCustomizers((builder) -> builder factory.addBuilderCustomizers((builder) -> builder
.setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxHttpPostSize)); .setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxHttpPostSize));
} }
...@@ -531,7 +531,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -531,7 +531,7 @@ public class DefaultServletWebServerFactoryCustomizer
} }
private static void customizeMaxHttpHeaderSize( private static void customizeMaxHttpHeaderSize(
JettyServletWebServerFactory factory, final int maxHttpHeaderSize) { JettyServletWebServerFactory factory, int maxHttpHeaderSize) {
factory.addServerCustomizers(new JettyServerCustomizer() { factory.addServerCustomizers(new JettyServerCustomizer() {
@Override @Override
...@@ -578,7 +578,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -578,7 +578,7 @@ public class DefaultServletWebServerFactoryCustomizer
} }
private static void customizeMaxHttpPostSize(JettyServletWebServerFactory factory, private static void customizeMaxHttpPostSize(JettyServletWebServerFactory factory,
final int maxHttpPostSize) { int maxHttpPostSize) {
factory.addServerCustomizers(new JettyServerCustomizer() { factory.addServerCustomizers(new JettyServerCustomizer() {
@Override @Override
...@@ -608,7 +608,7 @@ public class DefaultServletWebServerFactoryCustomizer ...@@ -608,7 +608,7 @@ public class DefaultServletWebServerFactoryCustomizer
} }
private static void customizeAccessLog(JettyServletWebServerFactory factory, private static void customizeAccessLog(JettyServletWebServerFactory factory,
final ServerProperties.Jetty.Accesslog properties) { ServerProperties.Jetty.Accesslog properties) {
factory.addServerCustomizers((server) -> { factory.addServerCustomizers((server) -> {
NCSARequestLog log = new NCSARequestLog(); NCSARequestLog log = new NCSARequestLog();
if (properties.getFilename() != null) { if (properties.getFilename() != null) {
......
...@@ -21,10 +21,8 @@ import org.junit.Test; ...@@ -21,10 +21,8 @@ import org.junit.Test;
import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.DirectFieldAccessor;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration;
import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportMessage;
import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext;
import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ContextConsumer;
...@@ -86,8 +84,6 @@ public class ReactiveSessionAutoConfigurationRedisTests ...@@ -86,8 +84,6 @@ public class ReactiveSessionAutoConfigurationRedisTests
private ContextConsumer<AssertableReactiveWebApplicationContext> validateSpringSessionUsesRedis( private ContextConsumer<AssertableReactiveWebApplicationContext> validateSpringSessionUsesRedis(
String namespace, RedisFlushMode flushMode) { String namespace, RedisFlushMode flushMode) {
return (context) -> { return (context) -> {
System.out.println(new ConditionEvaluationReportMessage(
context.getBean(ConditionEvaluationReport.class)));
ReactiveRedisOperationsSessionRepository repository = validateSessionRepository( ReactiveRedisOperationsSessionRepository repository = validateSessionRepository(
context, ReactiveRedisOperationsSessionRepository.class); context, ReactiveRedisOperationsSessionRepository.class);
assertThat(new DirectFieldAccessor(repository).getPropertyValue("namespace")) assertThat(new DirectFieldAccessor(repository).getPropertyValue("namespace"))
......
...@@ -165,7 +165,6 @@ content into your application. Rather, pick only the properties that you need. ...@@ -165,7 +165,6 @@ content into your application. Rather, pick only the properties that you need.
server.compression.min-response-size=2048 # Minimum response size that is required for compression to be performed. server.compression.min-response-size=2048 # Minimum response size that is required for compression to be performed.
server.connection-timeout= # Time that connectors wait for another HTTP request before closing the connection. When not set, the connector's container-specific default is used. Use a value of -1 to indicate no (that is, an infinite) timeout. server.connection-timeout= # Time that connectors wait for another HTTP request before closing the connection. When not set, the connector's container-specific default is used. Use a value of -1 to indicate no (that is, an infinite) timeout.
server.display-name=application # Display name of the application. server.display-name=application # Display name of the application.
server.max-http-header-size=0 # Maximum size, in bytes, of the HTTP message header.
server.error.include-exception=false # Include the "exception" attribute. server.error.include-exception=false # Include the "exception" attribute.
server.error.include-stacktrace=never # When to include a "stacktrace" attribute. server.error.include-stacktrace=never # When to include a "stacktrace" attribute.
server.error.path=/error # Path of the error controller. server.error.path=/error # Path of the error controller.
...@@ -186,6 +185,7 @@ content into your application. Rather, pick only the properties that you need. ...@@ -186,6 +185,7 @@ content into your application. Rather, pick only the properties that you need.
server.jetty.accesslog.time-zone=GMT # Timezone of the request log. server.jetty.accesslog.time-zone=GMT # Timezone of the request log.
server.jetty.max-http-post-size=0 # Maximum size, in bytes, of the HTTP post or put content. server.jetty.max-http-post-size=0 # Maximum size, in bytes, of the HTTP post or put content.
server.jetty.selectors= # Number of selector threads to use. server.jetty.selectors= # Number of selector threads to use.
server.max-http-header-size=0 # Maximum size, in bytes, of the HTTP message header.
server.port=8080 # Server HTTP port. server.port=8080 # Server HTTP port.
server.server-header= # Value to use for the Server response header (if empty, no header is sent) server.server-header= # Value to use for the Server response header (if empty, no header is sent)
server.use-forward-headers= # Whether X-Forwarded-* headers should be applied to the HttpRequest. server.use-forward-headers= # Whether X-Forwarded-* headers should be applied to the HttpRequest.
...@@ -1124,7 +1124,7 @@ content into your application. Rather, pick only the properties that you need. ...@@ -1124,7 +1124,7 @@ content into your application. Rather, pick only the properties that you need.
management.endpoints.web.base-path=/actuator # Base path for Web endpoints. Relative to server.servlet.context-path or management.server.servlet.context-path if management.server.port is configured. management.endpoints.web.base-path=/actuator # Base path for Web endpoints. Relative to server.servlet.context-path or management.server.servlet.context-path if management.server.port is configured.
management.endpoints.web.path-mapping= # Mapping between endpoint IDs and the path that should expose them. management.endpoints.web.path-mapping= # Mapping between endpoint IDs and the path that should expose them.
# ENDPOINTS CORS CONFIGURATION ({sc-spring-boot-actuator-autoconfigure}/endpoint/web/servlet/CorsEndpointProperties.{sc-ext}[CorsEndpointProperties]) # ENDPOINTS CORS CONFIGURATION ({sc-spring-boot-actuator-autoconfigure}/endpoint/web/CorsEndpointProperties.{sc-ext}[CorsEndpointProperties])
management.endpoints.web.cors.allow-credentials= # Whether credentials are supported. When not set, credentials are not supported. management.endpoints.web.cors.allow-credentials= # Whether credentials are supported. When not set, credentials are not supported.
management.endpoints.web.cors.allowed-headers= # Comma-separated list of headers to allow in a request. '*' allows all headers. management.endpoints.web.cors.allowed-headers= # Comma-separated list of headers to allow in a request. '*' allows all headers.
management.endpoints.web.cors.allowed-methods= # Comma-separated list of methods to allow. '*' allows all methods. When not set, defaults to GET. management.endpoints.web.cors.allowed-methods= # Comma-separated list of methods to allow. '*' allows all methods. When not set, defaults to GET.
......
...@@ -303,7 +303,7 @@ configuration permits `GET` and `POST` calls from the `example.com` domain: ...@@ -303,7 +303,7 @@ configuration permits `GET` and `POST` calls from the `example.com` domain:
management.endpoints.web.cors.allowed-methods=GET,POST management.endpoints.web.cors.allowed-methods=GET,POST
---- ----
TIP: See {sc-spring-boot-actuator-autoconfigure}/endpoint/web/servlet/CorsEndpointProperties.{sc-ext}[CorsEndpointProperties] for a complete list of options. TIP: See {sc-spring-boot-actuator-autoconfigure}/endpoint/web/CorsEndpointProperties.{sc-ext}[CorsEndpointProperties] for a complete list of options.
......
...@@ -767,7 +767,7 @@ property is `127.0.0.1`. Similarly, if the `production` profile is active, the ...@@ -767,7 +767,7 @@ property is `127.0.0.1`. Similarly, if the `production` profile is active, the
profiles are *not* enabled, then the value for the property is `192.168.1.100`. profiles are *not* enabled, then the value for the property is `192.168.1.100`.
If none are explicitly active when the application context starts, the default profiles If none are explicitly active when the application context starts, the default profiles
are activated . So, in the following YAML, we set a value for `security.user.password` are activated. So, in the following YAML, we set a value for `spring.security.user.password`
that is *only* available in the "default" profile: that is *only* available in the "default" profile:
[source,yaml,indent=0] [source,yaml,indent=0]
...@@ -790,6 +790,7 @@ necessary: ...@@ -790,6 +790,7 @@ necessary:
---- ----
server: server:
port: 8000 port: 8000
spring:
security: security:
user: user:
password: weak password: weak
...@@ -7125,7 +7126,7 @@ application. ...@@ -7125,7 +7126,7 @@ application.
Each test can use the runner to represents a particular use case. For instance, the sample Each test can use the runner to represents a particular use case. For instance, the sample
below invokes a user configuration (`UserConfiguration`) and checks that the below invokes a user configuration (`UserConfiguration`) and checks that the
auto-configuration backs off properly. Invoking `run` provides a callback context that can auto-configuration backs off properly. Invoking `run` provides a callback context that can
be used with `Assert4J`: be used with AssertJ:
[source,java,indent=0] [source,java,indent=0]
---- ----
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
package org.springframework.boot.autoconfigure; package org.springframework.boot.autoconfigure;
/** /**
* Simple service. * Sample service.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
......
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