BodyΒΆ
The following assertions can be performed on both request
and response
variables offered by the Touchstone Rules-Engine.
They would validate the presence or absence of payload in the request or response.
assertBodyNotEmpty()
Asserts that the request or response contains a payload
Examples:
request.assertBodyNotEmpty()
response.assertBodyNotEmpty()
Equivalent to these:
assertBodyNotEmpty(request)
assertBodyNotEmpty(response)
// operator can be passed as parameters from test script. assertBody("notEmpty", request)
// operator can be passed as parameters from test script. assertBody("notEmpty", response)
assert request.body != null: "Expected message body but did not find it in request"
assert response.body != null: "Expected message body but did not find it in response"
assert request.body: "Expected message body but did not find it in request"
assert response.body: "Expected message body but did not find it in response"
assertBodyEmpty()
Asserts that the request or response does not contain a payload
Examples:
request.assertBodyEmpty()
response.assertBodyEmpty()
Equivalent to these:
assertBodyEmpty(request)
assertBodyEmpty(response)
// operator can be passed as parameters from test script. assertBody("empty", request)
// operator can be passed as parameters from test script. assertBody("empty", response)
assert request.body==null: "Found message body when it was not expected in request"
assert response.body==null: "Found message body when it was not expected in response"
assert !request.body: "Found message body when it was not expected in request"
assert !response.body: "Found message body when it was not expected in response"