This project is more than just a suite of tests; it is a custom-built API automation framework designed to validate complex RESTful services with a focus on a Book Library API.
The goal was to move beyond simple scripts and create a professional, decoupled architecture that separates Test Logic, Data Management, and Environment Configuration. It ensures that as the API grows, the testing suite remains resilient, readable, and ready for CI/CD integration.
- API Orchestration: Rest-Assured (Fluent, BDD-style validation)
- Test Engine: TestNG (Advanced annotations and parallel execution capability)
- Data Serialization: Jackson Databind (Efficient JSON-to-POJO mapping)
- Build System: Maven
- Configuration: Java Properties (For seamless environment switching)
- Logging: SLF4J / Logback (For high-signal execution tracing)
Every developer has that moment of clarity. Mine happened while I was copying and pasting IDs from one Postman request to another for the 50th time. I realized I wasn't testing software; I was doing data entry.
I decided to build a "Librarian"—a framework that actually understands how a library should work.
The Journey involved:
- The "405" Wall: Realizing that a pretty JSON body means nothing if the headers aren't perfect. I spent nights debugging
RequestSpecificationsso the framework could handle them automatically. - The Data Breakup: I broke up with hardcoded strings. I built the
JSONDataManagerbecause tests should be told what to test, not how to find the data. - The Insight: A good framework shouldn't just find bugs; it should be a documentation source for how the API is supposed to behave.
The power of this project lies in its Separation of Concerns:
No more hardcoded maps. This layer uses Jackson to dynamically load test data from external .json files. This allows QA teams to add new test cases without touching a single line of Java code.
By abstracting environment variables (Base URLs, API keys, File paths) into a centralized .properties file, the framework is environment-agnostic. Switching from localhost to production is a one-line change.
Tests are organized using TestNG Priorities and Dependencies. This ensures a logical flow: we don't try to DELETE a book if the POST request to create it failed.
A custom utility that captures API responses and persists them to the target/ directory. This provides a "black box" recording of exactly what the server returned during a failure.
- Java 17 (LTS)
- Maven 3.8+
-
Clone the framework:
git clone https://github.com/your-username/Librarian-API-Framework.git cd Librarian-API-Framework -
Run the Full Suite:
mvn clean test -
Check the Reports: Open
target/surefire-reports/index.htmlin your browser to see the execution dashboard.
Architected with ☕ and precision by [Your Name].