Skip to content

Support simultaneous use of classes and locations in @ContextConfiguration [SPR-11634] #16257

@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-11634 and commented

Background

It should be up to a SmartContextLoader to decide if it supports both classes and locations. Historically there was no ApplicationContext that supported both XML resources and annotated classes (so you had to choose one as an entry point). That isn't the case any longer since Spring Boot doesn't care much what it eats.

Deliverables

  1. Stop throwing an IllegalArgumentException in the constructor in ContextConfigurationAttributes if both locations and classes are supplied.
  2. Update the Javadoc for all related classes to ensure that it doesn't state that locations and classes cannot be used simultaneously.
    • for example: ContextConfigurationAttributes, @ContextConfiguration, etc.
  3. Update the Testing chapter of the reference manual to ensure that it doesn't state that locations and classes cannot be used simultaneously.

Affects: 4.0.3

Referenced from: commits 8e89aff, 989f619, 1f017c4

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions