@DisplayNameGeneration
is not discovered on runtime enclosing type for @Nested
test class
#4131
Milestone
@DisplayNameGeneration
is not discovered on runtime enclosing type for @Nested
test class
#4131
Overview
@DisplayNameGeneration
is currently discovered on the current test, a superclass, or the enclosing class in which aNested
test class is declared. However, the runtime type of an enclosing instance is not always the class in which a@Nested
test class is declared.Example
The examples here are copies of those in #4130 except that
@IndicativeSentencesGeneration
has been moved fromAbstractBaseTests
toScenarioOneTests
.Actual Behavior
When running
ScenarioOneTests
, we currently see the following display names, since@IndicativeSentencesGeneration
is not honored (i.e., the@DisplayNameGeneration(IndicativeSentences.class)
meta-annotation is not discovered).ScenarioOneTests
NestedTests
test()
Expected Behavior
When running
ScenarioOneTests
, we would expect the following display names before #4130 is resolved.ScenarioOneTests
AbstractBaseTests, NestedTests
AbstractBaseTests, NestedTests, test()
When running
ScenarioOneTests
, we would expect the following display names after #4130 is resolved.ScenarioOneTests
ScenarioOneTests, NestedTests
ScenarioOneTests, NestedTests, test()
Related Issues
DisplayNameGenerator
cannot access runtime enclosing type for@Nested
test class #4130Deliverables
@DisplayNameGeneration
is discovered on the runtime enclosing type for a@Nested
test class.The text was updated successfully, but these errors were encountered: