A scalable, enterprise-grade REST API Automation Framework built using Java, REST Assured, TestNG, and Maven. The framework demonstrates modern API automation best practices including layered architecture, Builder Pattern, POJO Serialization & Deserialization, JSON Schema Validation, Data-Driven Testing, API Chaining, reusable utilities, centralized validations, reporting, and logging to deliver a maintainable, scalable, and production-ready automation solution.
- 📌 Key Highlights
- 🏗️ Tech Stack
- 🏛️ Framework Architecture
- 🎯 Framework Objectives
- 🌐 Application Under Test
- 📂 Project Structure
- ⚙️ Features
- 🧩 Design Patterns Used
- ⭐ Enterprise Features
- 🔄 API Test Coverage
- ✅ Prerequisites
▶️ How to Run the Framework- 📊 Framework Flow
- 🎯 Framework Design Goals
- 📸 Execution Reports
- 🔄 Future Enhancements
- 🔗 Related Repositories
- 👩💻 Author
- 📄 License
✔️ Enterprise Layered Framework Architecture
✔️ REST Assured API Layer
✔️ Builder Pattern Implementation
✔️ Request Specification Factory
✔️ POJO Serialization
✔️ POJO Deserialization
✔️ Dynamic PATCH Request using Map
✔️ Authentication Layer
✔️ JSON Schema Validation
✔️ Data-Driven Testing using Excel
✔️ API Chaining (CRUD Workflow)
✔️ Response Validation Utilities
✔️ Extent HTML Reporting
✔️ Log4j2 Logging
✔️ Configurable Environment
✔️ Modular & Reusable Utility Classes
✔️ Enterprise-ready Folder Structure
| Component | Technology |
|---|---|
| Programming Language | Java |
| API Automation | REST Assured |
| Test Framework | TestNG |
| Build Tool | Maven |
| Design Pattern | Builder Pattern |
| Serialization | Jackson POJO |
| Schema Validation | JSON Schema Validator |
| Test Data | Excel (Apache POI) |
| Reporting | Extent Reports |
| Logging | Log4j2 |
| Configuration | Properties File |
| Version Control | Git & GitHub |
| IDE | Eclipse / IntelliJ IDEA |
TestNG Suite
│
▼
Test Classes
│
▼
BookingAPI Layer
│
▼
RequestSpecificationFactory
│
▼
REST Assured Client
│
▼
API Response
│
┌───────────┴────────────┐
▼ ▼
Response Validation Schema Validation
│ │
└────────────┬───────────┘
▼
Serialization / Deserialization
│
▼
Extent Reports & Log4j2
The framework is designed to:
- Deliver scalable REST API automation.
- Promote reusable and maintainable code.
- Demonstrate enterprise REST Assured framework design.
- Validate API contracts using JSON Schema.
- Showcase modern API automation best practices.
- Provide a portfolio-ready enterprise automation framework.
- Simplify payload creation using Builder Pattern.
- Improve framework extensibility through modular architecture.
https://restful-booker.herokuapp.com
The framework automates complete REST API CRUD operations including:
- Authentication
- Create Booking
- Get Booking
- Update Booking
- Partial Update Booking (PATCH)
- Delete Booking
- Complete Booking Workflow
- JSON Schema Validation
- Response Validation
- API Chaining
.
├── src
│
├── test
│ ├── java
│ │
│ │── api
│ │ └── BookingAPI.java
│ │
│ │── builders
│ │ ├── AuthBuilder.java
│ │ ├── BookingBuilder.java
│ │ └── PatchBuilder.java
│ │
│ │── dataprovider
│ │ └── BookingDataProvider.java
│ │
│ │── endpoints
│ │ └── Routes.java
│ │
│ │── listeners
│ │ └── TestListener.java
│ │
│ │── models
│ │ ├── AuthRequest.java
│ │ ├── Booking.java
│ │ ├── BookingDates.java
│ │ └── BookingResponse.java
│ │
│ │── reports
│ │ └── ExtentManager.java
│ │
│ │── specifications
│ │ └── RequestSpecificationFactory.java
│ │
│ │── tests
│ │ ├── CreateBookingTest.java
│ │ ├── GetBookingTest.java
│ │ ├── UpdateBookingTest.java
│ │ ├── PartialUpdateBookingTest.java
│ │ ├── DeleteBookingTest.java
│ │ └── BookingWorkflowTest.java
│ │
│ │── utilities
│ │ ├── ConfigReader.java
│ │ ├── EnvironmentUtils.java
│ │ ├── ExcelUtils.java
│ │ ├── ExtentLogger.java
│ │ ├── JsonUtils.java
│ │ └── LoggerUtils.java
│ │
│ └── validators
│ └── ResponseValidator.java
│
├── src/test/resources
│ ├── config.properties
│ ├── log4j2.xml
│ ├── schema
│ └── testdata
│
├── testng.xml
├── pom.xml
└── README.md
🔥 Enterprise Layered Framework Architecture
🔥 REST Assured API Layer
🔥 Builder Pattern Implementation
🔥 Factory Pattern for Request Specifications
🔥 Authentication Module
🔥 POJO Serialization using Jackson
🔥 POJO Deserialization
🔥 Dynamic PATCH Requests using Map
🔥 Request Specification Factory
🔥 JSON Schema Validation
🔥 Centralized Response Validation
🔥 API Chaining
🔥 CRUD Workflow Automation
🔥 Excel Data-Driven Testing
🔥 Configurable Environment
🔥 Extent HTML Reporting
🔥 Log4j2 Logging
🔥 Reusable Utility Classes
🔥 Maven Dependency Management
🔥 Modular & Maintainable Framework
🔥 GitHub Portfolio Ready
The framework follows several industry-standard design patterns to improve scalability, maintainability, and code reusability.
| Design Pattern | Purpose |
|---|---|
| Builder Pattern | Reusable request payload creation |
| Factory Pattern | Centralized Request Specification creation |
| Singleton Pattern | Extent Report instance management |
| POJO Pattern | Serialization & Deserialization |
| Data Provider Pattern | Excel-based Data-Driven Testing |
| Layered Architecture | Separation of framework responsibilities |
| Utility Pattern | Reusable helper methods |
The framework has been designed following enterprise automation standards.
✔ Layered Framework Architecture
✔ Reusable API Layer
✔ Centralized Request Specifications
✔ Centralized Response Validators
✔ Dynamic Request Payload Creation
✔ Builder-based Payload Design
✔ Authentication Layer
✔ API Chaining
✔ CRUD Workflow Automation
✔ JSON Contract Validation
✔ Schema Validation
✔ Data-Driven Testing
✔ Extent HTML Reporting
✔ Log4j2 Logging
✔ Environment-based Configuration
✔ Modular & Scalable Framework Design
✔ GitHub Portfolio Ready
The framework currently automates the following REST API scenarios:
| Module | Status |
|---|---|
| Authentication | ✅ |
| Create Booking | ✅ |
| Get Booking | ✅ |
| Update Booking | ✅ |
| Partial Update Booking | ✅ |
| Delete Booking | ✅ |
| Complete CRUD Workflow | ✅ |
| API Chaining | ✅ |
| JSON Schema Validation | ✅ |
| Response Validation | ✅ |
| POJO Serialization | ✅ |
| POJO Deserialization | ✅ |
| Data-Driven Testing | ✅ |
| Dynamic PATCH Request | ✅ |
Before running the framework, ensure the following software is installed:
- Java 17 or above
- Maven 3.8+
- Eclipse IDE / IntelliJ IDEA
- Git
- Internet Connection (for Restful Booker API)
git clone https://github.com/Dishi-Gogia/rest-assured-api-framework.gitcd rest-assured-api-frameworkmvn clean installmvn clean testmvn test -DsuiteXmlFile=testng.xmlExamples:
CreateBookingTest
GetBookingTest
UpdateBookingTest
PartialUpdateBookingTest
DeleteBookingTest
BookingWorkflowTestAfter execution, the framework automatically generates:
- 📊 Extent HTML Report
- 📄 TestNG Reports
- 📝 Log4j2 Execution Logs
Note: Generated reports and logs are ignored through
.gitignoreand are not committed to the repository.
TestNG Suite
│
▼
Test Execution
│
▼
Data Provider (Excel)
│
▼
Builder Pattern (Payload)
│
▼
API Layer (BookingAPI)
│
▼
RequestSpecificationFactory
│
▼
REST Assured Client
│
▼
API Execution
│
▼
API Response
│
┌──────────────┴──────────────┐
▼ ▼
Response Validation JSON Schema Validation
│ │
└──────────────┬──────────────┘
▼
POJO Deserialization / Validation
│
▼
Extent Reports & Log4j2 Logging
The framework has been designed with enterprise automation principles in mind.
✔ Scalable Architecture
✔ Modular Design
✔ Code Reusability
✔ Easy Maintenance
✔ Readable & Clean Code
✔ Separation of Concerns
✔ Centralized Configurations
✔ Reusable API Components
✔ Data-Driven Testing
✔ Enterprise-ready Automation Framework
✔ GitHub Portfolio Ready
The framework automatically generates the following execution artifacts:
- 📊 Extent HTML Report
- 📄 TestNG Reports
- 📝 Log4j2 Execution Logs
The reports provide:
- Test Execution Summary
- Pass / Fail Status
- Request Body
- Response Body
- HTTP Method
- API Endpoint
- Status Code
- Response Time
- Exception Details (if any)
Note: Generated reports and logs are excluded from version control using
.gitignore.
This project demonstrates modern enterprise API automation practices rather than simple API test scripts.
Key engineering decisions include:
- Layered framework architecture
- Builder Pattern for request payload creation
- POJO Serialization & Deserialization using Jackson
- Factory Pattern for Request Specifications
- JSON Schema Validation
- Dynamic PATCH implementation using
Map<String, Object> - Centralized Response Validation
- API Chaining
- Data-Driven Testing using Excel
- Reusable utility components
- Extent Reporting
- Log4j2 Logging
The following enhancements are planned for future versions:
- ✅ OAuth 2.0 Authentication Support
- ✅ Jenkins CI/CD Integration
- ✅ GitHub Actions Pipeline
- ✅ Docker Support
- ✅ Parallel Test Execution
- ✅ API Mocking (WireMock)
- ✅ Contract Testing
- ✅ Environment Profiles
- ✅ Allure Reporting
- ✅ API + UI Unified Automation Framework
- ✅ Cloud Execution Support
Enterprise UI Automation Framework using Selenium WebDriver, Java, TestNG, Maven, Page Object Model (POM), Excel Data-Driven Testing, Extent Reports, and Log4j2.
Enterprise BDD Automation Framework using Cucumber, Selenium, Java, TestNG, Maven, and Page Object Model.
Modern Automation Framework using Playwright, Java, TypeScript, API Testing, and CI/CD.
Comprehensive Java concepts, coding exercises, collections, OOPs, exception handling, Java 8 features, and interview preparation designed specifically for QA Automation Engineers.
Senior QA Manager | Quality Engineering | Test Automation | REST Assured | Selenium | Java | Salesforce CRM | Oracle CPQ | API Testing
Passionate about building scalable automation frameworks and sharing practical knowledge with the QA community.
- 🌐 GitHub: https://github.com/Dishi-Gogia
- 💼 LinkedIn: https://www.linkedin.com/in/dishi-gogia
Contributions, suggestions, and improvements are welcome.
If you'd like to improve the framework:
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Raise a Pull Request.
If you found this project useful, please consider giving it a ⭐ Star.
It helps others discover the project and motivates continued improvements.
This project is licensed under the MIT License.
This framework was developed for learning, portfolio, demonstration, and interview preparation purposes.
It showcases enterprise API automation best practices using Java, REST Assured, TestNG, Maven, Builder Pattern, POJO Serialization & Deserialization, JSON Schema Validation, API Chaining, and Data-Driven Testing.
The framework is intended as a reference implementation for QA Engineers and Test Automation professionals looking to understand scalable REST API automation design.
🚀 Built with Java • REST Assured • TestNG • Maven