Mid-LevelAPI & Integration Testing
What is REST Assured and when would you use it over other API testing tools?
- REST Assured
- Java
- API tools
Answer it first, then compare. Nothing here is saved or scored.
Model answer
REST Assured is a Java library for testing REST APIs with a fluent, readable syntax: `given().header(...).when().get(...).then().statusCode(200)`. Use it when: your team is Java-based, you need tight integration with TestNG/JUnit, or you want type-safe request/response handling. Advantages: fluent DSL, JSON/XML path extraction, schema validation built-in. Alternatives: Postman+Newman (language-agnostic), Playwright API testing (JavaScript), Requests+pytest (Python).
What interviewers listen for
- Schema-first thinkingYou validate response shape before you assert on values, every time.
- Status-code literacyYou can defend why 401 vs 403 vs 422 matters for the consumer.
- Contract awarenessYou know when consumer-driven contract tests beat end-to-end checks.
- Auth fluencyYou can describe rotating tokens across parallel workers without secrets in logs.