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

Support additional JUnit Jupiter annotations #145

Closed
sbrannen opened this issue Oct 2, 2019 · 3 comments
Closed

Support additional JUnit Jupiter annotations #145

sbrannen opened this issue Oct 2, 2019 · 3 comments

Comments

@sbrannen
Copy link

sbrannen commented Oct 2, 2019

SpringJUnit5Check could be updated to consider all testable methods (e.g., @RepeatedTest, @ParameterizedTest, @TestFactory, and @TestTemplate) in addition to @Test methods.

@wilkinsona
Copy link
Contributor

#138 implements the @TestTemplate part of this.

@sbrannen
Copy link
Author

sbrannen commented Oct 2, 2019

@RepeatedTest and @ParameterizedTest are meta-annotated with @TestTemplate.

So if com.puppycrawl.tools.checkstyle.utils.AnnotationUtil finds meta-annotations, there would then be no need to search for explicitly for @RepeatedTest and @ParameterizedTest.

Actually, since the use of JUnit Jupiter annotations as meta-annotations will likely become more common over time, finding such meta-annotations would be a good idea anyway. For example, I often create custom composed annotations for @ParameterizedTest and a particular argument source (e.g., @MethodSource).

Edit: at a glance, it looks like AnnotationUtil does not search recursively for meta-annotations.

@philwebb philwebb changed the title Consider supporting JUnit Jupiter "test" methods other than @Test Support additional JUnit Jupiter annotations Dec 3, 2019
@philwebb philwebb added this to the 0.0.16 milestone Dec 3, 2019
@philwebb
Copy link
Contributor

philwebb commented Dec 3, 2019

Unfortunately checkstyle works only on the AST so finding meta-annotations isn't an option. I've just added them directly instead.

@philwebb philwebb modified the milestones: 0.0.16, 0.0.17 Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants