-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Closed
Description
Issue #3400 retrofitted @SpringApplicationConfiguration to use the new @AliasFor annotation from Spring Framework 4.2 to introduce explicit annotation attribute overrides.
Due to the opinionated view of Spring Boot with regard to favoring @Configuration classes over XML and Groovy configuration, @SpringApplicationConfiguration can benefit from yet another feature of @AliasFor. Namely, @SpringApplicationConfiguration can introduce a new value attribute that is an attribute override for the classes attribute in @ContextConfiguration.
Proposed change:
// ...
public @interface SpringApplicationConfiguration {
/**
* @return the context configuration classes
* @see ContextConfiguration#classes
* @see #classes
*/
@AliasFor(annotation = ContextConfiguration.class, attribute = "classes")
Class<?>[] value() default {};
// ...
}
Consequently, if a Spring Boot integration test only needs to declare a configuration class, the declaration can be simplified as follows: @SpringApplicationConfiguration(SampleApplication.class).
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement