private String fileContent(String fileName) throws IOException { return variables.interpret(read(configuration.classpathFile(fileName))); } }
public void attachment(String attachment) { File file = file(attachment); this.attachments.bodyPart(new FileDataBodyPart(file.getName(), file, APPLICATION_OCTET_STREAM_TYPE)); }
private String fileContent(String fileName) throws IOException { return variables.interpret(read(configuration.classpathFile(fileName))); } }
public void attachment(String attachment) { File file = file(attachment); this.attachments.bodyPart(new FileDataBodyPart(file.getName(), file, APPLICATION_OCTET_STREAM_TYPE)); }
@Then("^verify code file: ([^\"]*)") public void verifyCodeInFileTrue(String file) throws ScriptException, IOException { assertThat(eval(variables.interpret(read(configuration.classpathFile(file)))), is(true)); } }
@Then("^response body: ([^\"]*)$") public void verifyResponseBodyAgainstFile(String file) throws IOException { String content = variables.interpret(read(configuration.classpathFile(file))); assertThat(context.responseBody(), is(content)); }
@Then("^response body: ([^\"]*)$") public void verifyResponseBodyAgainstFile(String file) throws IOException { String content = variables.interpret(read(configuration.classpathFile(file))); assertThat(context.responseBody(), is(content)); }
@Then("^verify code file: ([^\"]*)") public void verifyCodeInFileTrue(String file) throws ScriptException, IOException { assertThat(eval(variables.interpret(read(configuration.classpathFile(file)))), is(true)); } }
@Given("^verify: '([^\"]*)' conform to: ([^\"]*)") public void verifyJsonConformSchemaFile(String path, String file) throws IOException { validateJsonSchema(actual.json(path), read(configuration.classpathFile(file))); }
@Given("^request body: ([^\"]*)$") public void requestBodyFromFile(String file) throws IOException { String fileName = configuration.classpathFile(file); context.requestBody(variables.interpret(read(fileName))); }
@Given("^verify: '([^\"]*)' conform to: ([^\"]*)") public void verifyJsonConformSchemaFile(String path, String file) throws IOException { validateJsonSchema(actual.json(path), read(configuration.classpathFile(file))); }
@Given("^verify: \\$\\{([^\"]*)} conform to: ([^\"]*)") public void verifyJsonInVariableConformSchemaFile(String name, String file) throws IOException { validateJsonSchema(variables.get(name), read(configuration.classpathFile(file))); }
@Then("^verify: '([^\"]*)'!=code file: ([^\"]*)$") public void verifyNotEqualsInFile(String path, String file) throws IOException, ScriptException { assertThat(actual.json(path), not(eval(variables.interpret(read(configuration.classpathFile(file)))))); }
@Given("^request body: ([^\"]*)$") public void requestBodyFromFile(String file) throws IOException { String fileName = configuration.classpathFile(file); context.requestBody(variables.interpret(read(fileName))); }
@Given("^verify: \\$\\{([^\"]*)} conform to: ([^\"]*)") public void verifyJsonInVariableConformSchemaFile(String name, String file) throws IOException { validateJsonSchema(variables.get(name), read(configuration.classpathFile(file))); }
@Then("^verify: '([^\"]*)'!=code file: ([^\"]*)$") public void verifyNotEqualsInFile(String path, String file) throws IOException, ScriptException { assertThat(actual.json(path), not(eval(variables.interpret(read(configuration.classpathFile(file)))))); }
@Then("^verify: '([^\"]*)'=code file: ([^\"]*)$") public void verifyEqualsCodeInFile(String path, String file) throws IOException, ScriptException { assertThat(actual.json(path), is(eval(variables.interpret(read(configuration.classpathFile(file)))))); }
@Then("^verify: '([^\"]*)'=code file: ([^\"]*)$") public void verifyEqualsCodeInFile(String path, String file) throws IOException, ScriptException { assertThat(actual.json(path), is(eval(variables.interpret(read(configuration.classpathFile(file)))))); }
@Then("^verify: \\$\\{([^\"]*)}!=code file: ([^\"]*)$") public void verifyVariableNotEqualsInFile(String path, String file) throws IOException, ScriptException { assertThat(variables.get(path), not(eval(variables.interpret(read(configuration.classpathFile(file)))))); }
@Then("^verify: \\$\\{([^\"]*)}=code file: ([^\"]*)$") public void verifyVariableEqualsCodeInFile(String path, String file) throws IOException, ScriptException { assertThat(variables.get(path), is(eval(variables.interpret(read(configuration.classpathFile(file)))))); }