Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate @…Test annotations with @ExtendWith(SpringExtension.class) #13739

Closed
wilkinsona opened this issue Jul 10, 2018 · 0 comments
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Jul 10, 2018

As a convenience for those using JUnit 5, we could annotate our @…Test annotations with @ExtendWith(SpringExtension.class). This would mean that this:

@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class SampleJunitJupiterApplicationTests {

Could be this instead:

@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class SampleJunitJupiterApplicationTests {

When JUnit 4 is being used, the @ExtendWith annotation would be dropped automatically by the JVM as it isn't on the classpath. Any ASM-based annotation discovery should already be sufficiently robust to ignore it too.

@wilkinsona wilkinsona added type: enhancement A general enhancement status: waiting-for-triage An issue we've not yet triaged labels Jul 10, 2018
@philwebb philwebb added for: team-attention An issue we'd like other members of the team to review and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Jul 10, 2018
@philwebb philwebb added this to the Backlog milestone Jul 11, 2018
@wilkinsona wilkinsona self-assigned this Jul 11, 2018
@wilkinsona wilkinsona modified the milestones: Backlog, 2.1.0.M1 Jul 11, 2018
bclozel added a commit that referenced this issue Jul 16, 2018
This is required for the docs module to inspect Spring Boot
annotations for meta-annotations.

See gh-13739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants