0

Consider this line:

response.body("path.to.some.long",is(getExpectedResult())

What I'm getting is:

java.lang.AssertionError: 1 expectation failed.
JSON path path.to.some.long doesn't match.
Expected: is <1500L>
  Actual: 1500

Does that mean REST assured compares a String to a Long? This is very limiting.

How can I tell REST assured to compare it as a long value?

IsaacLevon
  • 2,260
  • 4
  • 41
  • 83

1 Answers1

1

You'd have to go the traditional way

    long value = response.jsonPath().getLong("path.to.some.long");
    assertThat(value, is(1500L));
Wilfred Clement
  • 2,674
  • 2
  • 14
  • 29
  • 1
    TBH, it's a bummer since: (1) it requires an extra line of code. (2) it requires me to use my own assertion library, but I'm sure the creators of the library have their own reasoning – IsaacLevon Sep 18 '20 at 15:44