I have an endpoint which returns either true or false. Is it somehow possible to tell Hamcrest with RestAssured to check whether there exist one of mentioned two ? I've already tried containsString, hasItems etc, but none of them works i.e it checks for both of them.
get("http://localhost:8080/trueOrFalse")
.then()
.body(hasItems("true", "false")); // TRUE or FALSE not both
There is an either() method on the CombinableMatcher class.
Example
assertThat(result, either(is(true)).or(is(false)));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With