Skip to content

Local qualified @MethodSource factory method name treated differently than FQMN #3266

@sbrannen

Description

@sbrannen

Overview

This issue is both a bug report and an enhancement proposal.

Bug

When the @MethodSource factory methods involved are overloaded, a local qualified method name (LQMN) is not treated the same as a fully-qualified method name (FQMN).

Specifically, if the user provides a FQMN without specifying the parameter list, JUnit Jupiter will find the factory method that accepts zero arguments. Whereas, if the user provides an LQMN without specifying the parameter list, JUnit Jupiter will fail to find the factory method.

@MethodSource("org.example.MyClass#factoryMethod()") // works
@MethodSource("org.example.MyClass#factoryMethod") // works

@MethodSource("factoryMethod()") // works
@MethodSource("factoryMethod") // does NOT work

Enhancement

When a user provides a FQMN or LQMN without specifying the parameter list, JUnit Jupiter should fall back to the same lenient search semantics that are used to locate a "default" local factory method.

Related Issues

Deliverables

  • Fix bug
  • Implement enhancement
  • Update Javadoc
  • Update Release Notes
  • Backport to 5.9.x

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions