I'm trying to compare a Long to an id value in a response. I understand that an Integer 123 does not equals() a Long 123L, but is there a better way to make this comparison? Is there a way to tell body() to treat "id" as a Long? Is there a way to have the matcher compare the numeric value instead of just equals()?
Long val = Long.valueOf(123L)
expect().body("id", equalTo(val)) ...
JSON path id doesn't match.
Expected: <123L>
Actual: 123
Using Long.intValue() works for small numbers, but I'm looking for a solution that won't overflow.
expect().body("id", equalTo(val.intValue())) ...
Thanks,
Jason
--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.