All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cucumber.runtime.AmbiguousStepDefinitionsException Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy