Skip to main content
3 of 3
added 14 characters in body
dzieciou
  • 10.5k
  • 9
  • 48
  • 102

REST Assured API | Why we use equalTo() while asserting body part of response?

When we assert our body part, we use the method equalTo() but while asserting for Header, we are just providing ("Key","value") pair only. Why can't we use just- body("scope","APP") Any specific reason behind this?

Below is the actual code.

assertThat()
  .statusCode(200)
  .body("scope",equalTo("APP"))
  .header("Server","Apache/2.4.18 (Ubuntu)");