From e4a599f961fe4ed75a7e2d8fbc3fc26844b4d409 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 7 Jan 2017 02:24:46 +0100 Subject: [PATCH] Ensure that JUnit Jupiter tests are executed during build After the upgrade to JUnit Jupiter 5.0 M3, JUnit Jupiter tests in the Spring build were no longer executed due to the introduction of a default test class name pattern. This commit addresses this issue by making use of the @IncludeClassNamePatterns to specify that *TestCase test classes should be executed within the org.springframework.test.context.junit.jupiter package. --- .../test/context/junit/SpringJUnitJupiterTestSuite.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java b/spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java index e6b0e14fd5..e0581b5234 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java @@ -16,6 +16,7 @@ package org.springframework.test.context.junit; +import org.junit.platform.runner.IncludeClassNamePatterns; import org.junit.platform.runner.IncludeEngines; import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.runner.SelectPackages; @@ -47,6 +48,7 @@ import org.junit.runner.RunWith; @RunWith(JUnitPlatform.class) @IncludeEngines("junit-jupiter") @SelectPackages("org.springframework.test.context.junit.jupiter") +@IncludeClassNamePatterns("^.*TestCase$") @UseTechnicalNames public class SpringJUnitJupiterTestSuite { }