Skip to content

Cannot autowire individual constructor argument in @Nested test class [SPR-16653] #21194

@spring-projects-issues

Description

@spring-projects-issues

Sam Brannen opened SPR-16653 and commented

Overview

Due to a bug in javac in JDK versions prior to JDK 9, it is currently impossible to use @Autowired, @Qualifier, and @Value on individual constructor arguments if the constructor is in a JUnit Jupiter @Nested test class (i.e., an inner class) and the code was compiled using JDK < 9.

See #21193 and JUnit Jupiter issue #1345 for further details.

Deliverables

  • Ensure that @Autowired, @Qualifier, and @Value can be used on individual constructor arguments in @Nested test classes.

Affects: 5.0 GA

Issue Links:

Referenced from: commits 9244090

Metadata

Metadata

Assignees

Labels

in: testIssues in the test moduletype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions