This project demonstrates API automation testing using Java, Rest Assured, and JUnit 5 for the DummyAPI. It follows clean code principles and uses a simple pattern for API calls and reusable assertion helpers.
| Tool/Framework | Version | Purpose |
|---|---|---|
| Java JDK | 11+ | Language/runtime |
| Maven | 3.6+ (tested: 3.8/3.9) | Build, dependency management |
| Rest Assured | 5.3.0 | API automation framework |
| JUnit Jupiter (JUnit 5) | 5.9.3 | Test framework |
| Maven Surefire Plugin | 3.0.0-M7 | Test execution |
| JSON Path (Rest Assured) | 5.3.0 | JSON parsing in tests |
- Install Java (JDK 11 or newer)
- Download OpenJDK or Oracle JDK.
- Verify installation:
java -version # Should show version 11 or newer
- Install Maven (3.6 or newer recommended)
- Download Maven.
- Verify installation:
mvn -version # Should show Maven version 3.6 or newer
- Clone or copy this repository
- Place all files in a directory, e.g.
Java-API-Automation-Test-DummyAPI
- Place all files in a directory, e.g.
- (Optional) Update app-id
- The tests use the app-id
6112dc7c3f812e0d9b6679dd(seeDummyApiTests.java). If you have a different app-id, update the constant in the test class.
- The tests use the app-id
- Install Java
- Download and install OpenJDK or Oracle JDK.
- Verify installation:
java -version
- Install Maven
- Download and install Maven.
- Verify installation:
mvn -version
- Clone or copy this repository
- Place all files in a directory, e.g.
Java-API-Automation-Test-DummyAPI
- Place all files in a directory, e.g.
- (Optional) Update app-id
- The tests use the app-id
6112dc7c3f812e0d9b6679dd(seeDummyApiTests.java). If you have a different app-id, update the constant in the test class.
- The tests use the app-id
- Open a terminal and navigate to the project root:
cd /path/to/Java-API-Automation-Test-DummyAPI - Run the test suite using Maven:
mvn test
[INFO] Results:
[INFO]
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] BUILD SUCCESS
pom.xml— Maven configuration (dependencies: Rest Assured, JUnit 5)src/test/java/com/example/dummyapi/DummyApiTests.java— Main test classsrc/test/java/com/example/dummyapi/client/ApiClient.java— For API callssrc/test/java/com/example/dummyapi/TestUtils.java— Reusable assertion helpers
- Validates response status, data types, and paging
- Asserts all items in returned lists
- Negative test for missing app-id
- Clean code, reusable helpers, and simple design pattern
- If tests fail due to network issues, check your internet connection.
- If you get a 403/401 error, verify your app-id is correct and active.
- For Java/Maven errors, ensure both are installed and on your PATH.
