Rest Assured API Testing Interview Questions

Carvia Tech | July 23, 2020 | 2 min read | 26,489 views | Rest Assured


In this article we will cover important Rest Assured API testing Interview Questions for Automation Engineer and developers using Java and Kotlin

Rest Assured: Basic concepts

  • How do you compare Rest Assured with HttpClient or RestTemplate

  • How to test plain/text response body with REST Assured

  • How to test REST API that requires basic authentication

  • How to test REST API that requires digest authentication

  • How will you write a simple Rest Assured testcase that validates sample json response?

  • API returns a simple integer array [1, 2, 3], how to test such a response using Rest Assured?

  • How to get all books with price less than 10 from json response?

  • How to treat float and doubles as BigDecimal in json input

  • How to pass given parameters and headers to API call

  • How to set path params in API calls

  • How to test against an expected response code from API call

  • How to extract API responses after validation

  • How will you extract custom node from Json response using JsonPath?

  • How to set cookies in API calls?

  • How to set a JSON body for a POST API call?

  • How to verify cookie, status, headers & content-type in API response

  • How to measure and validate API response time?

  • How to test REST API that has CSRF enabled

  • How to test REST API that requires OAuth1 authentication

  • How to test OAuth2 protected resource using rest assured

  • How to test handle multi-part form data

  • Testing multipart file upload in Rest Assured

  • How to handle object mapping to JSON - serialization and deserialization

  • You have a fleet of APIs that requires n number of custom headers, how can you avoid duplicating the code for passing the same headers again and again?

  • How to handle session in test?

  • How to relax HTTP validation for invalid certificates? This may be the case for dev environment.

  • how to handle parameters that are already URL encoded?

Rest Assured: Logging and Listeners

  • How will you log network requests - params, body, headers, cookies, etc

  • How to print the response only if error occurs?

  • How to listen to response validation failures? For example, shoot an email when certain validation failure occurs?

Rest Assured with Spring

  • How to test a spring controller using stand alone mode in REST Assured

  • How to unit test Spring MVC async requests

  • How to test Spring Webflux Reactive Controller using RestAssured

Rest Assured with Kotlin

  • Using Kotlin for writing Rest Assured tests, a sample test

  • Advantages of writing Rest Assured tests using Kotlin

REST Assured with Junit 5

  • Basic tutorial of REST Assured testcase with Junit 5

  • Advantages of using Junit 5 with REST Assured


Rest Assured:
  1. RestAssured multipart file upload
  2. REST Assured Basic Authentication
  3. OAuth2 protected resources in RestAssured Testcases
See all articles in Rest Assured
Top articles in this category:
  1. 50 SDET Java Interview Questions & Answers
  2. REST Assured Basic Authentication
  3. SDET: JUnit interview questions for automation engineer
  4. RestAssured multipart file upload
  5. REST Assured with plain/text response body
  6. h2load for REST API benchmarking
  7. REST Assured vs Apache HttpClient and RestTemplate

Find more on this topic:

Recommended books for interview preparation: