How farhaanshareef/api-automation-rest-assured works
Project Type and Purpose
• This is an API-automation test framework (not a user-facing app).
• Purpose: execute CRUD API tests against a remote “User” service and generate HTML reports.
File Structure
• Top-level artifacts:
– pom.xml (Maven config/dependencies)
– testng.xml (TestNG suite definition)
– src/main/java/utils/ConfigReader.java (utility to read config.properties)
– src/main/resources/config.properties (base URL, credentials, etc.)
– src/test/java/tests (all TestNG test classes)
– reports/ (stores Extent Reports HTML output)
• Pattern: clear separation of Utilities, Test Definitions, Configuration, and Reporting.
README Insights
• Confirms technologies: Java, Rest Assured, TestNG, Extent Reports, Maven.
• Describes test cases (Create, Update, Patch, Delete, Get users).
• Build & run instructions (mvn install / mvn test → produce reports).
Main Components
a. Test Runner Layer
– TestNG engine (driven by testng.xml)
– Maven Surefire / Failsafe plugin (invokes TestNG on mvn test)
b. Test Code Layer
– Test Classes (TestCreateUser, TestUpdateUser, etc.)
– BaseTest (shared setup/teardown)
– Utils.ConfigReader (reads config.properties)
c. REST-Client Layer
– Rest Assured library (constructs HTTP requests, deserializes responses)
d. External System
– API Under Test (remote “User” service)
e. Reporting Layer
– Extent Reports (listens to TestNG events, generates HTML files under reports/)
f. Build & Dependency Management
– Maven (pom.xml defines dependencies for TestNG, Rest Assured, Extent Reports)
Architectural Patterns and Principles
• Layered Separation: Build/CI (Maven), Execution (TestNG), Utilities, REST client, Reporting.
• Single-source Configuration: config.properties drives all environment settings.
• Reusability: BaseTest and ConfigReader reduce duplication across tests.
Technologies & Frameworks to Call Out
• Java 11+
• Rest Assured (io.restassured)
• TestNG (org.testng)
• Extent Reports (com.aventstack.extentreports)
• Maven (pom.xml)