Browse Source

Merge branch '1.5.x'

pull/8035/head
Stephane Nicoll 9 years ago
parent
commit
7253bb334c
  1. 5
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfiguration.java
  2. 4
      spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

5
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ImportAutoConfiguration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2016 the original author or authors. * Copyright 2012-2017 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,6 +31,9 @@ import org.springframework.core.annotation.AliasFor;
* rules as {@code @EnableAutoConfiguration} but restricts the auto-configuration classes * rules as {@code @EnableAutoConfiguration} but restricts the auto-configuration classes
* to the specified set, rather than consulting {@code spring.factories}. * to the specified set, rather than consulting {@code spring.factories}.
* <p> * <p>
* Can also be used to {@link #exclude()} specific auto-configuration classes such that
* they will never be applied.
* <p>
* Generally, {@code @EnableAutoConfiguration} should be used in preference to this * Generally, {@code @EnableAutoConfiguration} should be used in preference to this
* annotation, however, {@code @ImportAutoConfiguration} can be useful in some situations * annotation, however, {@code @ImportAutoConfiguration} can be useful in some situations
* and especially when writing tests. * and especially when writing tests.

4
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

@ -5344,6 +5344,10 @@ providing a `@...Test` annotation that loads the `ApplicationContext` and one or
more `@AutoConfigure...` annotations that can be used to customize auto-configuration more `@AutoConfigure...` annotations that can be used to customize auto-configuration
settings. settings.
NOTE: Each slice loads a very restricted set of auto-configuration classes. If you need to
exclude one of them, most `@...Test` annotation provide an `excludeAutoConfiguration`
attribute. Alternatively, you can use `@ImportAutoConfiguration#exclude`.
TIP: It's also possible to use the `@AutoConfigure...` annotations with the standard TIP: It's also possible to use the `@AutoConfigure...` annotations with the standard
`@SpringBootTest` annotation. You can use this combination if you're not interested `@SpringBootTest` annotation. You can use this combination if you're not interested
in '`slicing`' your application but you want some of the auto-configured test beans. in '`slicing`' your application but you want some of the auto-configured test beans.

Loading…
Cancel
Save