DisplayNameGenerator
cannot access runtime enclosing type for @Nested
test class
#4130
Milestone
DisplayNameGenerator
cannot access runtime enclosing type for @Nested
test class
#4130
Overview
A
DisplayNameGenerator
can access the type of a@Nested
test class as well as the enclosing class in which a@Nested
test class is declared, but it cannot access the concrete type of the enclosing instance for a@Nested
test class.When a
DisplayNameGenerator
is used to build hierarchical display names, this can lead to confusing results or even conflicting results depending on the structure of the test classes used, "conflicting" in the sense that two nested test classes may have identical display names that do not represent the runtime structure of the test classes.Example
Actual Behavior
When running
ScenarioOneTests
andScenarioTwoTests
, we currently see the following display names.ScenarioOneTests
AbstractBaseTests, NestedTests
AbstractBaseTests, NestedTests, test()
ScenarioTwoTests
AbstractBaseTests, NestedTests
AbstractBaseTests, NestedTests, test()
Expected Behavior
When running
ScenarioOneTests
andScenarioTwoTests
, we would expect the following display names.ScenarioOneTests
ScenarioOneTests, NestedTests
ScenarioOneTests, NestedTests, test()
ScenarioTwoTests
ScenarioTwoTests, NestedTests
ScenarioTwoTests, NestedTests, test()
Related Issues
@DisplayNameGeneration
is not discovered on runtime enclosing type for@Nested
test class #4131Deliverables
DisplayNameGenerator
can access the concrete type of the enclosing instance for a@Nested
test class.The text was updated successfully, but these errors were encountered: