Java API Test Automation is an automated API testing project built with Java. It uses JUnit Jupiter for test execution and RestAssured for HTTP requests and response validation.
The project demonstrates a structured approach to API test automation, with reusable components for request configuration, response handling, assertions, logging, and test support.
The tests are implemented against the ServeRest API, providing a practical example of API test automation using a real REST API.
Before running the project, make sure you have installed:
- Java JDK 25;
- Maven 3.9+;
- Your preferred IDE (IntelliJ IDEA, Eclipse, VS Code etc.).
- Clone the repository:
git clone https://github.com/felseje/java-api-test-automation.git
cd java-api-test-automation- Install the Maven dependencies:
mvn clean installThe API tests are implemented as integration tests and follow the *IT naming convention. They are executed by the Maven Failsafe Plugin.
To run the tests:
mvn verifyFailsafe test reports are generated in:
target/failsafe-reports
src/
├── main/
│ ├── java/
│ │ └── io/github/felseje/apitestautomation/
│ │ ├── client/ # API clients and DTOs
│ │ ├── config/ # Application and test configuration
│ │ ├── core/ # Core HTTP and test support components
│ │ ├── exception/ # Custom exceptions
│ │ ├── factory/ # Request and response specification factories
│ │ ├── service/ # Service-level operations
│ │ └── util/ # Shared utility classes
│ └── resources/
│ └── config/
└── test/
├── java/
│ └── io/github/felseje/apitestautomation/
│ ├── suite/ # Test suites
│ ├── test/ # API integration tests (*IT)
│ └── testdata/ # Test data
└── resources/
└── schemas/ # JSON schemas for response validation
├── login/
└── user/
The project contains automated integration tests against the ServeRest API, covering different API behaviors and demonstrating how the test automation components can be used in practice.
- Java 25 – Modern, high-performance JDK
- Maven – Build automation and dependency management
- JUnit Jupiter 6 – Unit and integration testing framework
- RestAssured 6 – Simplified REST API testing
- Awaitility 4.3 – Handling asynchronous operations in tests
- SLF4J + Logback – Logging framework
- Lombok – Boilerplate code reduction
- Owner – Type-safe configuration management
This project is licensed under the MIT License. See the LICENSE file for details.