Error Testing
Use ERROR when a call is expected to fail.
Basic error expectation
php
--- ENDPOINT ---
user.UserService/GetUser
--- REQUEST ---
{ "user_id": "missing" }
--- ERROR ---
{
"code": 5,
"message": "User not found"
}Error with assertions
php
--- ERROR with_asserts=true ---
{
"code": 3,
"message": "Invalid input"
}
--- ASSERTS ---
.code == 3
.message | contains("Invalid")Notes:
RESPONSEandERRORcannot be in the same test fileERRORsupportswith_asserts=true|false