@Override public void runStep(Scenario scenario) throws Throwable { int argumentCount = getArguments().size(); Integer parameterCount = stepDefinition.getParameterCount(); if (parameterCount != null && argumentCount != parameterCount) { throw arityMismatch(parameterCount); } List<Object> result = new ArrayList<>(); try { for (Argument argument : getArguments()) { result.add(argument.getValue()); } } catch (UndefinedDataTableTypeException e) { throw registerTypeInConfiguration(e); } catch (CucumberExpressionException | CucumberDataTableException e) { throw couldNotConvertArguments(e); } try { stepDefinition.execute(result.toArray(new Object[0])); } catch (CucumberException e) { throw e; } catch (Throwable t) { throw removeFrameworkFramesAndAppendStepLocation(t, getStepLocation()); } }
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); }