0

How can we verify the Json data type of mentioned fields such as "price", "ck", "name", "enabled" and "tags" in rest assured test.

{
  "odd": {
    "price": 200,
    "ck": 12.2,
    "name": "test this",
    "enabled": true,
    "tags": null
  }
}

Is there any way or any assertion library which provide data type verification as mentioned in rest assured test example where instead of asserting the actual value of given key we can verify only the data type

ValidatableResponse response =
            
given().
    spec(requestSpec).
    headers("authkey", "abcdxxxxxxxxxyz").
    pathParam("uid", oddUid).
when().
    get("/orders" + "/{uid}").
then().
    assertThat().
    statusCode(200).
    body(
           "odd.price",  isNumber(),
           "odd.name", isString(),
           "enabled", isboolean()
           "tags", isNull()
         );
5

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.