GitHub Repo

Book API Testing Framework

A comprehensive framework for automated API testing of a Book system.

Tech Stack

Label Tool
Language Java 21+
API Testing Rest Assured
Test Framework TestNG
Reporting Allure
Logging Log4j2
JSON Jackson (serialization/deserialization)
Assertions Hamcrest
Build Tool Maven

Key Functionalities

Key Classes & Utilities

Project Structure

book-api-rest-assured-test-automation/
            │
            ├── .github/                                        # GitHub workflows and actions
            │   └── workflows/
            │       └── test-execution.yml                      # CI workflow for running tests
            ├── .gitignore                                      # Git ignore rules
            │
            ├── github-pages/                                   # Static site for documentation/demo
            │   ├── index.html
            │   └── style.css
            │
            ├── pom.xml                                         # Maven build and dependencies
            │
            ├── README.md                                       # Project documentation
            │
            ├── src/
            │   ├── main/
            │   │   ├── java/
            │   │   │   ├── pojos/
            │   │   │   │   └── Book.java                      # Book POJO for API payloads
            │   │   │   └── utils/
            │   │   │       ├── JsonUtils.java                 # JSON utility methods
            │   │   │       └── RestAssuredLogFilter.java      # Custom RestAssured logging
            │   │   │
            │   │   └── resources/
            │   │       └── log4j2.xml                         # Logging configuration
            │   │   
            │   └── test/
            │       └── java/
            │           ├── tests/
            │           │   ├── BaseTest.java                  # Test base class
            │           │   ├── TS01_CreateBook.java           # Test: Create Book
            │           │   ├── TS02_GetBook.java              # Test: Get Book
            │           │   ├── TS03_UpdateBook.java           # Test: Update Book
            │           │   └── TS04_DeleteBook.java           # Test: Delete Book
            │           │
            │           └── testUtils/
            │               ├── AnnotationTransformer.java     # TestNG annotation helper
            │               ├── RetryAnalyzer.java             # Retry logic for flaky tests
            │               ├── TestResultLoggerListener.java  # TestNG result logger
            │               ├── Assertion.java                 # Custom assertions with logging
            │               ├── LoggingMatcher.java            # Hamcrest matcher with logging
            │               ├── TestResultsReporter.java       # Collects and exports test results to JSON
            │               └── TestResultsRecords.java        # Data structures for test results JSON
            │ 
            ├── test-results/                                  # Test output and logs
            │   ├── allure-results/                            # Allure results
            │   └── logs/
            │       └── books-api-test.log                     # Test execution log
            ├── testng.xml                                     # TestNG suite configuration
        

📊 Test Groups

🔥 Smoke Tests

Critical functionality tests including basic CRUD operations with valid data

mvn clean test -Dgroups=smoke

🔄 Regression Tests

Comprehensive test coverage including all positive and negative scenarios

mvn clean test -Dgroups=regression

❌ Negative Tests

Error handling validation including unauthorized access and invalid data

mvn clean test -Dgroups=negative

🚀 CI/CD & Automation

GitHub Actions Workflow: Sophisticated CI/CD pipeline with flexible test execution and comprehensive reporting capabilities.

View Workflow Runs | Manual Dispatch

Azure DevOps Test Plan Integration

Below are sample screenshots showing how test results are posted and visualized in Azure DevOps Test Plans:

ADO Progress Report
Progress Report
ADO Run Summary
Run Summary
ADO Test Result Summary
Test Result Summary
ADO Test Results
Test Results in Azure DevOps
Enlarged Azure DevOps Screenshot