Skip to content

Instantly share code, notes, and snippets.

@Romeh
Created December 3, 2017 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Romeh/dbaa202cf1c61e1e73d92ee377c6f11f to your computer and use it in GitHub Desktop.
Save Romeh/dbaa202cf1c61e1e73d92ee377c6f11f to your computer and use it in GitHub Desktop.
/**
* 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