Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* how the feature is executed
*/
public class GetHealthStep extends CucumberRoot {
private ResponseEntity<String> response; // output
@When("^the client calls /health$")
public void the_client_issues_GET_health() throws Throwable {
response = template.getForEntity("/health", String.class);
}
@Then("^the client receives response status code of (\\d+)$")
public void the_client_receives_status_code_of(int statusCode) throws Throwable {
HttpStatus currentStatusCode = response.getStatusCode();
assertThat("status code is incorrect : " +
response.getBody(), currentStatusCode.value(), is(statusCode));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment