Closed
Description
Sam Brannen opened SPR-14183 and commented
Status Quo
Java 8 introduced support for interface default methods. JUnit 5 as well as some existing Runner
implementations for JUnit 4.x already support default methods in various scenarios -- for example, @Test
, @BeforeEach
, etc. However, the Spring TestContext Framework does not yet support the declaration of @BeforeTransaction
and @AfterTransaction
on default methods: it simply does not find them.
Deliverables
- Update the annotated method search algorithms in
TransactionalTestExecutionListener
so that@BeforeTransaction
and@AfterTransaction
can be declared on interface default methods.
Issue Links:
- Make ReflectionUtils.doWithMethods work on Java 8 default interface methods [SPR-12822] #17419 Make ReflectionUtils.doWithMethods work on Java 8 default interface methods
- Support test annotations on interfaces [SPR-14184] #18755 Support test annotations on interfaces