Expected
Tests declared within a @Nested inner class inheriting from their parent abstract class should run out of the box.
Actual
No tests are picked up.
Rationale
I want to test multiple strategies (MapperEngine). In order to verify feature parity, the tests are abstract functions.
To avoid boilerplate and group the tests, the strategy implementation verifications are inner classes of the abstract class.
Steps to reproduce
abstract class MapperEngineTest {
abstract fun map()
@Nested
inner class Liquid : MapperEngineTest() {
@Test
// this test should run, but it doesn't
override fun map() { ... }
}
@Nested
inner class Replace {
@Test
// doesn't run either (this time without inheriting the abstract class)
fun map() { ... }
}
}
Context
- Used versions: JUnit 5.10.2
- Build Tool/IDE: Gradle 8.10.2, IntelliJ 2024.3 RC
Expected
Tests declared within a
@Nested inner classinheriting from their parentabstract classshould run out of the box.Actual
No tests are picked up.
Rationale
I want to test multiple strategies (
MapperEngine). In order to verify feature parity, the tests areabstract functions.To avoid boilerplate and group the tests, the strategy implementation verifications are
inner classes of theabstract class.Steps to reproduce
Context