public String getPattern() { return stepDefinition.getPattern(); }
@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 registerTypeInConfiguration(Exception e) { return new CucumberException(String.format("" + "Could not convert arguments for step [%s] defined at '%s'.\n" + "It appears you did not register a data table type. The details are in the stacktrace below.", //TODO: Add doc URL stepDefinition.getPattern(), stepDefinition.getLocation(true) ), e); }
private CucumberException couldNotConvertArguments(Exception e) { return new CucumberException(String.format( "Could not convert arguments for step [%s] defined at '%s'.\n" + "The details are in the stacktrace below.", stepDefinition.getPattern(), stepDefinition.getLocation(true) ), e); }
private CucumberException arityMismatch(int parameterCount) { List<String> arguments = createArgumentsForErrorMessage(); return new CucumberException(String.format( "Step [%s] is defined with %s parameters at '%s'.\n" + "However, the gherkin step has %s arguments%sStep text: %s", stepDefinition.getPattern(), parameterCount, stepDefinition.getLocation(true), arguments.size(), formatArguments(arguments), step.getText() )); }
public StepDefinitionDTO(UUID glueId, long id, StepDefinition stepDefinition) { this.glueId = glueId; this.id = id; this.pattern = stepDefinition.getPattern(); this.parameterCount = stepDefinition.getParameterCount(); this.location = stepDefinition.getLocation(false); this.detailedLocation = stepDefinition.getLocation(true); }