Skip to content

Display names must not be allowed to be blank #743

@sbrannen

Description

@sbrannen

Status Quo

It is currently possible to declare @DisplayName("") (or containing only white space), but this should not be permitted.

If a user explicitly declares @DisplayName, the user must provide a non-empty name.

The same applies to display name patterns supplied via @RepeatedTest and @ParameterizedTest.

Related Issues

Deliverables

  • Introduce appropriate JavaDoc for DisplayName.value.
  • ❌ Introduce precondition check to ensure that a user has supplied a non-empty name via @DisplayName.
    • See TODO in TestInfoParameterResolverTests.customDisplayNameThatIsEmpty()
    • Instead of using precondition checks, we can currently only log a warning. See commit f03cc6d for details.
  • Ensure that the precondition check is applied to @Test, @TestFactory, and @TestTemplate methods (for repeated and parameterized tests as well).
  • Ensure that all extensions or internal mechanisms that generate or return a display name return non-empty values.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions