public String interpret(String value) { String replaced = replace(value, variables); String content = new JsonPathExpression(verifying).evaluate(replaced); return new FakerExpression(configuration.faker()).evaluate(content); }
@Given("^var: ([^\"' ]*)=(\\d+)$") public void defineIntegerVariable(String key, int value) { variables.assign(key, value); }
@Given("^base uri: ([^\"]*)") public void baseUri(String uri) { configuration.baseUri(variables.interpret(uri)); }
@Given("^verify: \\$\\{([^\"]*)} conform to:") public void verifyJsonInVariableConformSchema(String name, String schemaJson) throws IOException { validateJsonSchema(variables.get(name), schemaJson); }
public String interpret(String value) { String replaced = replace(value, variables); String content = new JsonPathExpression(verifying).evaluate(replaced); return new FakerExpression(configuration.faker()).evaluate(content); }
@Given("^request body:$") public void requestBody(String body) { context.requestBody(variables.interpret(body)); }
@Given("^var: ([^\"' ]*)=(\\d+)$") public void defineIntegerVariable(String key, int value) { variables.assign(key, value); }
@Given("^query parameter: '([^\"]*)'=\"([^\"]*)\"$") public void queryParameterFromString(String name, String value) { context.queryParameter(name, variables.interpret(value)); }
@Given("^var: ([^\"' ]*)='([^\"]*)'$") public void defineLiteralStringVariable(String key, String value) { variables.assign(key, value); }
@Given("^base uri: ([^\"]*)") public void baseUri(String uri) { configuration.baseUri(variables.interpret(uri)); }
@Given("^var: ([^\"' ]*)='([^\"]*)'$") public void defineLiteralStringVariable(String key, String value) { variables.assign(key, value); }
@Given("^var: ([^\"' ]*)=random uuid") public void defineRandomUUIDVariable(String name) { variables.assign(name, UUID.randomUUID()); }
@Given("var: ([^\"' ]*)<-cookie:'([^\"]*)'$") public void defineVariableByCookieName(String key, String cookieName) { variables.assign(key, context.getCookieValue(cookieName)); } }
@Given("var: ([^\"' ]*)<-cookie:'([^\"]*)'$") public void defineVariableByCookieName(String key, String cookieName) { variables.assign(key, context.getCookieValue(cookieName)); } }
@Given("^var: ([^\"' ]*)<-'([^\"]*)'$") public void defineVariableExtractByJsonPath(String key, String path) throws IOException { variables.assign(key, toBeVerified.json(path)); }
@Given("^var: ([^\"' ]*)<-response body$") public void defineVariableExtractByResponseBody(String key) { variables.assign(key, toBeVerified.plainText()); }