Skip to content

REST Assured interview questions — Easy

159 easy-level REST Assured questions from our API Testing bank, each with the correct answer and an explanation of why it is correct.

What this covers

REST Assured appears throughout API Testing interviews. At easy level, interviewers are typically checking that you know the fundamentals and can describe them precisely — definitions, defaults, and the basic mechanics. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. While onboarding a junior QA, you explain: How do you assert data.id == 5 in a REST Assured body?

    • A. Body("data.id", equalTo(5)).correct
    • B. AssertEquals(5).
    • C. Then().json(5).
    • D. Expect(5).

    Why: REST Assured uses JsonPath with Hamcrest matchers.

  2. 2. What is the purpose of then().statusCode(200) in REST Assured?

    • A. Begins validation of the received response.correct
    • B. Sends the HTTP request to the endpoint.
    • C. Adds a query string parameter to the request.
    • D. Sets or asserts the JSON content type.

    Why: then().statusCode(200): Begins validation of the received response.

  3. 3. In the context of REST Assured, when().get("/users") is best described as:

    • A. Sends the HTTP request to the endpoint.correct
    • B. Begins validation of the received response.
    • C. Reusable set of response expectations.
    • D. Sets or asserts the JSON content type.

    Why: when().get("/users"): Sends the HTTP request to the endpoint.

  4. 4. In REST Assured, what does then().statusCode(200) do or refer to?

    • A. Begins validation of the received response.correct
    • B. Reusable set of response expectations.
    • C. Starts request specification: params, headers, body, auth.
    • D. Sets or asserts the JSON content type.

    Why: then().statusCode(200): Begins validation of the received response.

  5. 5. In a CI/CD pipeline review, consider this: extract().path("token") is used to:

    • A. Send a request.
    • B. Pull a value from the response for reuse.correct
    • C. Assert time.
    • D. Log headers.

    Why: extract() pulls values (JsonPath) to reuse, e.g. an auth token.

  6. 6. Which of the following best describes then().statusCode(200) in REST Assured?

    • A. Sets or asserts the JSON content type.
    • B. Sends the HTTP request to the endpoint.
    • C. Begins validation of the received response.correct
    • D. Disables SSL certificate validation for test environments.

    Why: then().statusCode(200): Begins validation of the received response.

  7. 7. Which of the following best describes relaxedHTTPSValidation() in REST Assured?

    • A. Adds a query string parameter to the request.
    • B. Disables SSL certificate validation for test environments.correct
    • C. Sets a named path parameter in the URL template.
    • D. Begins validation of the received response.

    Why: relaxedHTTPSValidation(): Disables SSL certificate validation for test environments.

  8. 8. In REST Assured, what does contentType(ContentType.JSON) do or refer to?

    • A. Begins validation of the received response.
    • B. Sends the HTTP request to the endpoint.
    • C. Sets or asserts the JSON content type.correct
    • D. Starts request specification: params, headers, body, auth.

    Why: contentType(ContentType.JSON): Sets or asserts the JSON content type.

  9. 9. What is the purpose of ResponseSpecification in REST Assured?

    • A. Adds a query string parameter to the request.
    • B. Disables SSL certificate validation for test environments.
    • C. Reusable set of response expectations.correct
    • D. Begins validation of the received response.

    Why: ResponseSpecification: Reusable set of response expectations.

  10. 10. Which of the following best describes ResponseSpecification in REST Assured?

    • A. Disables SSL certificate validation for test environments.
    • B. Sends the HTTP request to the endpoint.
    • C. Reusable set of response expectations.correct
    • D. Adds a query string parameter to the request.

    Why: ResponseSpecification: Reusable set of response expectations.

  11. 11. What is the purpose of contentType(ContentType.JSON) in REST Assured?

    • A. Sets a named path parameter in the URL template.
    • B. Adds a query string parameter to the request.
    • C. Sets or asserts the JSON content type.correct
    • D. Begins validation of the received response.

    Why: contentType(ContentType.JSON): Sets or asserts the JSON content type.

  12. 12. In REST Assured, what does relaxedHTTPSValidation() do or refer to?

    • A. Disables SSL certificate validation for test environments.correct
    • B. Begins validation of the received response.
    • C. Adds a query string parameter to the request.
    • D. Sets a named path parameter in the URL template.

    Why: relaxedHTTPSValidation(): Disables SSL certificate validation for test environments.

  13. 13. Which of the following best describes contentType(ContentType.JSON) in REST Assured?

    • A. Reusable set of response expectations.
    • B. Starts request specification: params, headers, body, auth.
    • C. Sets or asserts the JSON content type.correct
    • D. Sets a named path parameter in the URL template.

    Why: contentType(ContentType.JSON): Sets or asserts the JSON content type.

  14. 14. Which of the following best describes given() in REST Assured?

    • A. Disables SSL certificate validation for test environments.
    • B. Starts request specification: params, headers, body, auth.correct
    • C. Sends the HTTP request to the endpoint.
    • D. Begins validation of the received response.

    Why: given(): Starts request specification: params, headers, body, auth.

  15. 15. What is the purpose of relaxedHTTPSValidation() in REST Assured?

    • A. Starts request specification: params, headers, body, auth.
    • B. Sets or asserts the JSON content type.
    • C. Disables SSL certificate validation for test environments.correct
    • D. Reusable set of response expectations.

    Why: relaxedHTTPSValidation(): Disables SSL certificate validation for test environments.

  16. 16. Which of the following best describes when().get("/users") in REST Assured?

    • A. Disables SSL certificate validation for test environments.
    • B. Starts request specification: params, headers, body, auth.
    • C. Sends the HTTP request to the endpoint.correct
    • D. Sets a named path parameter in the URL template.

    Why: when().get("/users"): Sends the HTTP request to the endpoint.

  17. 17. In REST Assured, what does ResponseSpecification do or refer to?

    • A. Starts request specification: params, headers, body, auth.
    • B. Disables SSL certificate validation for test environments.
    • C. Reusable set of response expectations.correct
    • D. Sets or asserts the JSON content type.

    Why: ResponseSpecification: Reusable set of response expectations.

  18. 18. In REST Assured, what does when().get("/users") do or refer to?

    • A. Adds a query string parameter to the request.
    • B. Disables SSL certificate validation for test environments.
    • C. Sends the HTTP request to the endpoint.correct
    • D. Starts request specification: params, headers, body, auth.

    Why: when().get("/users"): Sends the HTTP request to the endpoint.

  19. 19. What is the purpose of given() in REST Assured?

    • A. Sets or asserts the JSON content type.
    • B. Disables SSL certificate validation for test environments.
    • C. Begins validation of the received response.
    • D. Starts request specification: params, headers, body, auth.correct

    Why: given(): Starts request specification: params, headers, body, auth.

  20. 20. While onboarding a junior QA, you explain: REST Assured tests use which readable style?

    • A. Arrange/act/assert.
    • B. Setup/run/verify.
    • C. Given()/when()/then().correct
    • D. Open/send/close.

    Why: REST Assured uses BDD-style given/when/then.

Related API Testing topics