This question isn't about REST, but about using the returned value from an invocation made in @When
in the subsequent @Then
.
I am looking at using JBehave to test some calls to a REST api. First there is a post
to create the user
When I create a user with name Charles Darwin
As I understand REST, and this is what the Atom api does, the id is returned in the location header, e.g. /user/22
. So then I want to assert something about the response.
Then user was created with a valid Id
I can do this by creating a member variable in the Steps class and storing the response there, and I have used this approach before, but is this the correct way?