Consider JUnit Jupiter test classes in TestTypeExcludeFilter

Previously, TestTypeExcludeFilter only looked for JUnit 4 class
and method annotations when determining if a class was a test class.
As a result, if an application was using JUnit Jupiter, its test
classes would not be exluded during component scanning.

This commit expands TestTypeExcludeFilter to also identify classes
using JUnit Jupiter. This includes classes (meta-)annotated with
@ExtendWith and methods (meta-)annotated with @Testable. The later
provides detection of Jupiter's @Test, @TestFactory, and @RepeatedTest
annotations all of which are meta-annotated with @Testable.

Closes gh-6898
This commit is contained in:
Andy Wilkinson
2017-09-21 11:19:41 +01:00
parent e9147c2f20
commit 7c1bc68fbe
7 changed files with 164 additions and 5 deletions

View File

@@ -167,6 +167,11 @@
<artifactId>spring-webmvc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>