Skip to content

Make factory method search algorithm used for @MethodSource reusable #4599

@robstoll

Description

@robstoll

There are two aspects I would like to reuse of the MethodSource annotation mechanism:

  1. the logic to find a suiting method (implemented in MethodArgumentsProvider.findMethod)
  2. The tooling support associated with it -- intellij allows to jump to the method, include it in references etc. (see https://github.com/JetBrains/intellij-community/blob/master/plugins/junit/src/com/intellij/execution/junit/references/JUnitReferenceContributor.kt)

Deliverables

  • for point 1: make MethodArgumentsProvider.findMethod re-usable
  • for point 2:
    • introduce a marker Annotation which specifies (as contract) that the value of the annotation represents method references
    • annotate MethodSource with this annotation (the intellij junit plugin could then base it's implementation on the marker annotation)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions