REST Assured Practice Online: Java API Testing Exercises
Practice BDD-style API test automation with REST Assured 5 and JUnit 5 directly in your browser. Solve hands-on challenges against authentic REST endpoints with real-time assertion feedback—no Maven, JDK, or local environment needed.
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.*;
import static org.hamcrest.Matchers.*;
class ApiTest {
@Test
void testAuthenticationAndResource() {
String token = given()
.contentType(ContentType.JSON)
.body("{\"email\":\"qa@target.dev\",\"password\":\"Test@123\"}")
.when()
.post("/auth/token")
.then()
.statusCode(200)
.body("token", not(emptyOrNullString()))
.extract().path("token");
given()
.header("Authorization", "Bearer " + token)
.when()
.get("/auth/me")
.then()
.statusCode(200);
}
}Curriculum Labs
Hands-On Practice Exercises
Module 1: HTTP fundamentals
Understand requests, responses, and status codes.
- 1Send a GET request and assert 200Easy 12m
- 2Read and assert a response headerEasy 12m
- 3Assert the content-type headerEasy 12m
- 4Understand 2xx status codesEasy 12m
- 5Understand 4xx status codesEasy 12m
- 6Understand 5xx status codesEasy 12m
- 7Assert the response timeMedium 25m
- 8Inspect a JSON response bodyEasy 12m
Module 2: Requests & methods
Exercise the full set of HTTP verbs.
- 1Create a resource with POSTEasy 12m
- 2Read a resource with GETEasy 12m
- 3Replace a resource with PUTMedium 25m
- 4Update a field with PATCHMedium 25m
- 5Delete a resource and verifyMedium 25m
- 6Send query parametersEasy 12m
- 7Send path parametersEasy 12m
- 8Send custom request headersMedium 25m
- 9Send a form-urlencoded bodyMedium 25m
Module 3: Working with JSON
Parse, extract, and assert on payloads.
Module 4: Schema & contracts
Validate response shape and types.
Module 5: Authentication
Test every common auth mechanism.
Module 6: Authorization & negative testing
Probe boundaries and error paths.
Module 7: Data-driven & parameterization
Cover permutations efficiently.
Module 8: GraphQL
Query and validate GraphQL APIs.
Module 9: Mocking & virtualization
Isolate services with mocks.
Module 10: Integration, performance & CI
Ship trustworthy API suites.
Want the Full 64-Challenge API Testing Curriculum?
Our comprehensive track covers HTTP fundamentals, JSON extraction, OAuth2 token rotation, rate limits, GraphQL, and downstream microservice mocking.
Frequently Asked Questions About REST Assured (Java) Practice
Can I run REST Assured tests in the browser without installing Java or Maven?↓
Yes. TargetQA includes a built-in AST interpreter for REST Assured 5 syntax, Hamcrest matchers (equalTo, containsString, hasItem, notNullValue, etc.), and JUnit 5 annotations. Your code executes directly in the browser against authentic live API endpoints.
What REST Assured concepts can I practice here?↓
You will practice baseURI configuration, given/when/then request chaining, query and path parameter injection, request and response body assertions, token extraction, JSON schema validation, and multi-step integration flows.
Is this suitable for SDET interview preparation?↓
Yes. REST Assured is the standard API automation framework requested in Java SDET technical interviews. TargetQA's challenges mirror real interview questions asked by top tech employers.