API Test Automation with REST Assured
- 75 lessons
- Self-paced
Start with lesson 1
75 lessons. The first one is free, no signup needed.
What you'll learn
- Write given-when-then API tests in Java that send a request and check the status line and response body.
- Build requests with path and query parameters, headers, JSON bodies and reusable request and response specifications.
- Read response data with GPath and extract responses into classes for chained tests.
- Test authentication and negative security cases, and tell a 401 result from a 403 result.
- Validate JSON schemas, use logging for debugging, and organise parameterised tests and suites with JUnit 5.
About this course
API Test Automation with REST Assured is an MCQ practice course for testers and developers who write automated API tests in Java. The course uses REST Assured for requests and assertions and JUnit 5 for running the tests. Each lesson shows one idea in a short reading card, then asks a multiple-choice question about it, so you learn why a check is written a certain way and what a failing check tells you.
Who this REST Assured course is for
It is written for manual testers moving into automation, QA engineers in India who are asked to add API coverage, and Java developers who want to test their own services. You should know basic Java syntax and how to run a Maven project. If Java is new, learn the language first. The course assumes you can read a class and a method, but it explains the REST Assured and JUnit parts from the start. For a broader look at test design, see Software Testing and QA Automation.
How the lessons work
Each lesson opens with reading cards about one request or one assertion. Code blocks show the given, when and then steps in context, and a short table or example explains what each part checks. A multiple-choice quiz follows, and every answer, right or wrong, has an explanation. The first lessons test a single GET request. Later ones add status line checks, body assertions, HTTP method rules, and the reasoning behind negative tests.
Assertions and status codes
Most of the value in an API test sits in its assertions. The course explains the difference between a status code check and a full status line check, how to assert a body field, and how to read a failing assertion so you can tell a broken API from a wrong expectation. It covers the four core HTTP methods, the status code families, and why a repeated DELETE should still leave the system in the same state. It also shows why 401 and 403 are different results and must be tested as different results.
Requests, data and debugging
The course covers path and query parameters, headers, form and JSON bodies, and how a POJO is turned into JSON for a request. It explains GPath for reading response fields, such as finding one item in a list by a value, and why extracting into a class can be clearer than reading a long path. Logging is taught as a debugging tool: it can print everything, or only the request and response for a test that failed, so a passing suite stays quiet. For the Java side of test structure, see JUnit and Mockito: Java Testing.
Common API testing traps
- Expecting matchesJsonSchemaInClasspath to come with the core REST Assured artifact. It needs the separate json-schema-validator artifact.
- Expecting auth().basic to send credentials up front. It waits for a 401 challenge; preemptive().basic sends them on the first request.
- Reading time() as seconds. It asserts milliseconds by default.
- Writing Jupiter tests with @Before and @Test from the old JUnit 4 package. Jupiter uses org.junit.jupiter.api and @BeforeEach.
- Assuming tests run in file order. Jupiter order is not guaranteed unless @TestMethodOrder is set, so tests should not depend on each other.
MCQ practice vs video courses for REST Assured
Udemy and Coursera have many API automation video courses, and they suit learners who want an instructor to build a framework on screen. This course is a different format: short explanations followed by questions that ask you to predict what a check returns or which assertion is wrong. The REST Assured documentation is the reference for every method, and this course tests the same ideas in question form. Many testers use a video course to build a project and this course to check the concepts after each section.
Best way to learn REST Assured
Write the request before you read the options. Name the status you expect and the field you want to check, then read the explanation even when you were right. Test one thing at a time, and run each test so you see it fail once, which proves the assertion can fail. When a question is about a default, such as log levels or the order of tests, confirm it in a small project. Keep the course's traps in mind, because they are the mistakes a reviewer will catch first.
Jobs that ask for Test Automation
9,519 live openings list Test Automation as a required skill.
SDE - Customer Engineering | Automation Testing - Selenium | Pre-sales & Post-sales
BrowserStack
Agentic QA Lead
Weekday 1
DevOps Engineer
Accenture
Hardware Test Engineer
NVIDIA
Senior Software Development Engineer in Test
Okta