Re-enable shadowed, overridden @Test and lifecycle methods

Due to a bug (or "unintentional feature") in JUnit 4, overridden test
and lifecycle methods not annotated with @Test, @Before, @After, etc.
are still executed as test methods and lifecycle methods; however,
JUnit Jupiter does not support that. Thus, prior to this commit, some
overridden test and lifecycle methods were no longer executed after the
migration from JUnit 4 to JUnit Jupiter.

This commit addresses this issue for such known use cases, but there
are likely other such use cases within Spring's test suite.

See gh-23451
This commit is contained in:
Sam Brannen
2019-08-22 13:16:14 +02:00
parent 05c270d916
commit 3e2b977d5d
7 changed files with 10 additions and 2 deletions

View File

@@ -52,6 +52,7 @@ public class AnnotationDrivenNamespaceTests extends AbstractJmsAnnotationDrivenT
}
@Override
@Test
public void fullConfigurableConfiguration() {
ApplicationContext context = new ClassPathXmlApplicationContext(
"annotation-driven-full-configurable-config.xml", getClass());

View File

@@ -71,6 +71,7 @@ public class EnableJmsTests extends AbstractJmsAnnotationDrivenTests {
}
@Override
@Test
public void fullConfigurableConfiguration() {
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(
EnableJmsFullConfigurableConfig.class, FullConfigurableBean.class);