How oktaliem/restassuredalluretestng works
Project type and purpose
• This is a Java-based API test automation project built with Maven.
• It uses RestAssured to send HTTP requests, TestNG as the test execution framework, and Allure for test reporting.
File structure
• Top-level files:
• pom.xml – Maven build configuration, declares dependencies and plugins.
• README.md – usage instructions.
• .gitignore
• src/test/java/com/oktaliem/GetEmployee.java – a single TestNG test class that calls a dummy REST endpoint.
README for additional insights
• Describes two execution flows:
• “mvn clean test -Dtest=GetEmployee” to run the test via Maven Surefire + TestNG.
• “mvn allure:report” (or “allure serve”) to generate and view an Allure HTML report.
• Mentions plugin configurations for Surefire, AspectJ weaving (to capture Allure steps), and Allure Maven Plugin.
Main components & relationships
a. Components
1. Maven Build System
– Surefire plugin to launch TestNG
– Allure Maven Plugin to generate report
2. TestNG Test Runner
3. Test Code (GetEmployee.java)
4. RestAssured Library
5. External REST API (dummy.restapiexample.com)
6. Allure Results Store (target/allure-results)
7. Allure Report (target/site/allure-maven-plugin)
b. Interactions
– Maven Surefire → invokes TestNG
– TestNG → loads GetEmployee.java
– GetEmployee → uses RestAssured to send HTTP GET → receives JSON response → assertions
– Allure TestNG listener (via AspectJ) collects test steps & writes to target/allure-results
– Allure Maven Plugin reads allure-results → generates HTML under target/site/allure-maven-plugin
c. Architectural patterns & principles
– Layered approach: Build/Orchestration layer (Maven) → Test execution layer (TestNG + tests) → Library layer (RestAssured) → Reporting layer (Allure)
– Clear separation of concerns: test logic vs. HTTP client vs. reporting
d. Key technologies
– Java, Maven, TestNG, RestAssured, SLF4J (NOP binding), Allure, AspectJ (for weaving)