@Override public void addStepDefinition(StepDefinition stepDefinition) { StepDefinition previous = stepDefinitionsByPattern.get(stepDefinition.getPattern()); if (previous != null) { throw new DuplicateStepDefinitionException(previous, stepDefinition); } stepDefinitionsByPattern.put(stepDefinition.getPattern(), stepDefinition); }
private CucumberException arityMismatch(int parameterCount) { List<Argument> arguments = createArgumentsForErrorMessage(step); return new CucumberException( String.format( "Arity mismatch: Step Definition '%s' with pattern [%s] is declared with %s parameters. However, the gherkin step has %s arguments %s. \nStep: %s%s", stepDefinition.getLocation(true), stepDefinition.getPattern(), parameterCount, arguments.size(), arguments, step.getKeyword(), step.getName())); }
public String getPattern() { return stepDefinition.getPattern(); }