The project uses a controlled REST API to demonstrate practical API automation patterns while keeping the framework independent, repeatable, and easy to extend.
REST Assured handles API interaction, while TestNG manages test execution and data-driven scenarios. Common request and response behavior is centralized to reduce duplication, Java models support structured payload handling, and Maven manages dependencies and execution.
The framework also integrates automated reporting and GitHub Actions so the API test suite can be validated consistently through CI.
Testing: REST API functional automation
Language: Java 17
Core Library: REST Assured
Test Framework: TestNG
Build Tool: Maven
Coverage: GET, POST, PUT, DELETE and negative scenarios
Validation: Status codes, response data and JSON Schema
Reporting: ExtentReports
CI/CD: GitHub Actions
The Challenge
API automation becomes difficult to maintain when tests contain duplicated request configuration, hard-coded payloads, repeated assertions, and endpoint-specific setup scattered throughout the test suite.
The objective of this project was to build a framework that separates API interaction from test logic while keeping tests readable, reusable, and easy to extend as coverage grows.
The framework needed to support multiple REST operations and validation techniques without requiring each test to recreate the underlying HTTP configuration or test infrastructure.
Key objectives:
Centralize common request and response configuration
Separate reusable API operations from test scenarios
Support GET, POST, PUT, and DELETE workflows
Validate status codes, response payloads, and JSON schemas
Support data-driven testing with external test data
Generate automated execution reports
Keep environment and configuration values outside test logic
Execute the automated suite consistently through CI
Framework Design & Architecture
The framework was designed to keep API interaction, configuration, test data, validation, and test scenarios separated rather than embedding everything directly inside individual tests.
A reusable API client encapsulates endpoint operations, while centralized request and response specifications define common HTTP behavior. Configuration values are externalized, and Java models provide structured objects for request and response payloads.
TestNG manages test execution and data-driven scenarios, while JSON Schema validation provides an additional contract-level check on API responses. This structure allows new scenarios to reuse the existing framework components instead of duplicating setup and request logic.
The main framework components include:
API Client — Encapsulates reusable REST API operations
Request Specifications — Centralizes base URI, headers, content type, and common request configuration
GitHub Actions — Executes and validates the framework through CI
REST Assured API automation framework architecture showing reusable API clients, centralized request/response specifications, configuration management, data-driven testing, schema validation, automated reporting, and GitHub Actions CI.
API Test Implementation
The test suite exercises the API through reusable client methods rather than constructing HTTP requests independently inside every test. This keeps the test scenarios focused on behavior and validation while the framework handles the underlying request construction.
The automated coverage includes retrieval, creation, update, deletion, and negative scenarios. REST Assured responses are validated using assertions for HTTP status codes and response content, with JSON Schema validation used where structural contract validation is required.
Test data is separated from the test logic so scenarios can be executed with different datasets without duplicating test methods. Request payloads can also be represented through Java models and serialized into JSON, keeping payload construction structured and maintainable.
Key implementation capabilities:
Reusable methods for GET, POST, PUT, and DELETE requests
Positive and negative API test scenarios
Status-code and response-body assertions
JSON Schema contract validation
Java object serialization for request payloads
Data-driven execution through TestNG
Externalized test data and configuration
Reusable request and response specifications
REST Assured API automation framework in VS Code, showing the modular project structure and a create-user test using reusable API clients, response specifications, model-based test data, and response assertions.
API Test Coverage & Validation
The automated suite covers the core CRUD lifecycle through dedicated GET, POST, PUT, and DELETE test scenarios. Tests are kept focused on business validation while reusable client and specification layers handle the underlying API interaction and common HTTP behavior.
Validation is performed at multiple levels. Tests verify expected HTTP status codes and response payload values, while reusable response specifications provide consistent validation across scenarios. JSON Schema validation is also included to verify that API responses conform to the expected contract.
The framework includes negative scenarios alongside successful API flows, helping verify how the service behaves when requests or expected conditions are invalid. Test data and configuration are externalized where appropriate so the suite can be maintained and extended without embedding environment-specific values throughout the test code.
This structure keeps the test layer readable while allowing common API behavior, models, specifications, configuration, reporting, and test utilities to evolve independently.
Automated REST API regression execution report showing successful GET, POST, PUT, DELETE, negative, and data-driven test scenarios with request details, status-code validation, response timing, and execution results.
Automated Reporting & Execution Evidence
The framework integrates ExtentReports to provide traceable execution results for the automated API suite. Each test execution records the scenario outcome along with relevant API details such as the HTTP method, endpoint, status code, response time, and execution status.
The report provides a consolidated view of CRUD operations, negative validation, and data-driven scenarios. This makes failures easier to investigate while providing clear evidence of what was executed and whether the expected API behavior was successfully validated.
Reporting is integrated into the framework rather than treated as a separate manual activity, allowing execution evidence to be generated consistently whenever the suite runs.
CI/CD Automation
The API regression suite is integrated with GitHub Actions so automated validation runs consistently as part of the development workflow. The pipeline executes on pushes and pull requests to the main branch and can also be triggered manually when required.
The workflow provisions Java 17, restores Maven dependencies, and executes the complete API test suite using Maven. Test execution therefore uses the same repeatable build process in CI rather than depending on a developer's local environment.
Execution evidence is also preserved by preparing the generated test results and uploading them as CI artifacts. The artifact step runs even when a test fails, ensuring that diagnostic evidence remains available for investigating unsuccessful pipeline executions.
This provides an automated path from source change → build environment → API regression execution → test evidence, making the framework suitable for continuous regression validation.
GitHub Actions CI workflow for the REST Assured framework, automatically configuring Java 17, executing the Maven API regression suite, and preserving generated test results as downloadable CI artifacts.
Project Outcome
This project demonstrates a maintainable REST API automation framework rather than a collection of isolated API tests. The framework separates test scenarios from reusable API clients, request and response specifications, models, configuration, test data, and reporting components.
The automated suite validates the core API lifecycle through GET, POST, PUT, and DELETE operations while also covering negative and data-driven scenarios. Response validation includes HTTP status codes, payload values, and API contract validation, with execution evidence captured through automated reporting.
GitHub Actions extends the framework into CI by automatically executing the Maven test suite and preserving generated test results as pipeline artifacts. This provides a repeatable workflow from code change through automated regression validation and execution evidence.
Key outcomes:
Built a modular REST Assured API automation framework using Java and TestNG
Automated GET, POST, PUT, and DELETE API workflows
Added negative and data-driven test scenarios
Centralized reusable API clients and request/response specifications
Implemented model-based payload handling
Validated status codes, response data, and JSON schemas
Integrated ExtentReports for traceable execution evidence
Automated regression execution through GitHub Actions
Preserved CI test results as downloadable pipeline artifacts
The complete framework, including automated API tests, reusable clients and specifications, Java models, test data, JSON schemas, reporting integration, and GitHub Actions CI workflow, is available in the GitHub repository.