Skip to content

Throw exception when @ContextConfiguration#classes are not annotated with @Configuration [SPR-10971] #15599

Closed
@spring-projects-issues

Description

@spring-projects-issues

Wojciech Krak opened SPR-10971 and commented

I think that would be nicer if the TestContext framework would throw an exception if a class declared via @ContextConfiguration#classes is not annotated with @Configuration.

If a configuration class has many annotations it is easy to forget to annotate it with @Configuration. With the status quo, it is possible that an empty application context is created, which can be a bit surprising.


Affects: 3.2.4

Issue Links:

Referenced from: commits 7ffd05a

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulestatus: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions