Skip to content

Introduce validation rules for tests #121

Closed
@jlink

Description

@jlink

Status Quo

Using JUnit 5 annotations and mechanisms one can do a lot of things that are syntactically possible but don't make sense. For example, one can annotate a method with both @Test and @BeforeEach.

Proposal

Introduce a mechanism where JUnit itself but also other parties can register rules that will be checked during discovery time, e.g.:

  • AmbiguousAnnotationsRule
  • DuplicateExtensionsRule
  • ProhibitNestedTestsRule (in case a project wants to forbid this style of testing)

Those rules should be listable and configurable from the launcher API: Error, Warning, Off

Rules could work on different level, e.g whole test plan, engine, package, class, method, etc.

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions