Arnauld/jbehave-eclipse-plugin — Issue #27: Step priorities are not considered to disambiguate steps
Author: dschneller
Created: 2012-02-02 15:08:57+00:00
State: open

Given a simple steps class with these two methods:

@Given("noop $X")
public void noop(@Named("X") String X) {
}

@Given(value="noop ", priority=1)
public void noop2(@Named("X") String X) {
}

JBehave will at runtime use `noop2()` (prio 1 > prio 0 (default)) when `` comes from an example table. When a value like "foo" is used instead of the angle-bracketed table value placeholder ``, the first method `noop()` will match.

The plugin however complains

Ambiguous step: 2 steps are matching > got: [[GIVEN]noop $a, BasicSteps#noop, [GIVEN]noop , BasicSteps#noop2]

The priority in the 2nd annoation disambiguates and should be taken into account.