How mitesh411/apiwithenvironmentv works
Project Type & Purpose
• The project is an API Automation Testing Framework built with Java and Maven.
• It is designed for automating API testing (using RestAssured), managing test execution through TestNG, and integrating seamlessly with CI/CD pipelines via GitHub Actions.
• Key design features include the Service Object Model pattern, builder classes, and custom listeners/filters for logging and reporting.
Analyzing the File Structure
• The top-level directories/files (e.g., .github with its workflows, README.md, Postman collection and environment files) indicate the project’s integration with CI/CD and support for external API testing setups.
• The presence of GitHub Actions workflows (e.g., blank.yml and pynt.yml) confirms continuous integration aspects, while the Postman JSON files hint at leveraging or validating API requests/environments.
• Although the core Java code files are not explicitly shown in the file tree, the README details core components such as Service Objects, Builder Classes, and Listeners.
Identifying the Main Architectural Components
a. Core Testing Framework (Java/Maven):
• Contains the test execution logic using TestNG and integration with Maven (via Surefire Plugin for JUnit reports).
• Implements API testing using RestAssured.
b. Service & Builder Layers:
• Service Object Model to manage reusable API interaction modules.
• Builder Classes for assembling dynamic and complex API request payloads.
c. Logging & Reporting Modules:
• Listeners and Filters that capture and log request/response data, and enrich the reporting with custom information.
d. CI/CD Pipeline Component:
• GitHub Actions workflows that automate test execution on code pushes or pull requests.
• Integration points with GitHub (via workflows in .github/workflows) that trigger the Maven build and test pipelines.
e. External Configuration:
• Postman collection and environment JSON files that provide baseline API configurations and testing scenarios.
Mapping Interactions & Relationships
• The Core Testing Framework drives test execution and interacts with:
• The Service Objects (and Builder Classes) to form and send API requests.
• The Logging & Reporting Modules to capture and report on the test outcomes.
• The CI/CD Pipeline (GitHub Actions) triggers the core tests through Maven build scripts.
• External configuration files (Postman collections/environments) may serve as reference data for API endpoints or dynamic test data, influencing the request payloads generated by the Builder classes.
Architectural Patterns & Technologies
• Service Object Model: Encourages modular design of API interactions.
• Builder Pattern: For constructing complex payloads.
• Integration via Listeners/Filters: Ensures enhanced logging and traceability.
• CI/CD with GitHub Actions: Demonstrates an effective continuous testing strategy.
• Technologies include Java, Maven, TestNG, and RestAssured. GitHub Actions handles automation, while Postman configurations provide standardized testing inputs.