private void allStepDefinitionFieldsShouldBeResolvedIn(String stepDescription) { Map<String, Object> fields = description.getDisplayedFields(); for (String field : fields.keySet()) { if (stepDescription.contains(fieldNameFor(field))) { throw new AssertionError( stepDescription + " : " + field + " value could not be resolved"); } } }
public String into(String stepDescription) { Map<String, Object> fields = description.getDisplayedFields(); for (String field : fields.keySet()) { String fieldName = fieldNameFor(field); Object value = fields.get(field); if (stepDescription.contains(fieldName) && (value != UNDEFINED)) { stepDescription = StringUtils.replace(stepDescription, fieldNameFor(field), stringValueFor(value)); } } // allStepDefinitionFieldsShouldBeResolvedIn(stepDescription); return stepDescription; }