🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101

API test suite (Postman and REST Assured)

Test a public REST API for status codes, response schema, data and error handling, manually and automated.

Beginner⏱ 6–10 hoursđŸĒœ 7 stepsPostmanJavaREST Assured

What you'll learn

  • ◆HTTP methods and status codes
  • ◆Schema validation
  • ◆Chaining requests and environments

What you'll build

  • ✓Postman collection with tests
  • ✓REST Assured automated suite
  • ✓JSON schema validation
  • ✓Negative tests (bad input, missing auth)

Step-by-step guide

  1. 1

    Pick an API

    A practice API such as reqres.in or restful-booker (designed for testing).

  2. 2

    Postman

    Requests for list, get, create, update, delete; pm.test assertions on status and fields; environment variables for base URL and token.

  3. 3

    Chain requests

    Save an id or token from one response into a variable and use it in the next request.

  4. 4

    REST Assured

    given().baseUri(...).body(...).when().post("/booking").then().statusCode(200).body("bookingid", notNullValue()).

  5. 5

    Schema

    Validate responses with matchesJsonSchemaInClasspath("booking-schema.json").

  6. 6

    Negative tests

    Missing fields, wrong types, no token, unknown id; check the API returns proper errors.

  7. 7

    Run in CI

    Run Postman collections with newman and REST Assured with mvn test in GitHub Actions.

🚀 Make it stand out

  • +Contract testing
  • +Performance smoke test
  • +Test data cleanup