cucumber.runtime.AmbiguousStepDefinitionsException Maven / Gradle / Ivy
package cucumber.runtime;
import java.util.List;
public class AmbiguousStepDefinitionsException extends CucumberException {
private final List matches;
public AmbiguousStepDefinitionsException(List matches) {
super(createMessage(matches));
this.matches = matches;
}
private static String createMessage(List matches) {
StringBuilder msg = new StringBuilder();
msg.append(matches.get(0).getStepLocation()).append(" matches more than one step definition:\n");
for (StepDefinitionMatch match : matches) {
msg.append(" ").append(match.getPattern()).append(" in ").append(match.getLocation()).append("\n");
}
return msg.toString();
}
public List getMatches() {
return matches;
}
}