# oktaliem/restassuredalluretestng architecture

> Architecture diagram of the GitHub repository oktaliem/restassuredalluretestng, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oktaliem/restassuredalluretestng
- Repository: https://github.com/oktaliem/restassuredalluretestng

## Overview

##### 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)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Build & Orchestration"
        Maven["Maven Build System\n(Surefire & Allure Plugin)"]:::build
        README["Project README / Usage Instructions"]:::build
    end

    subgraph "Test Execution"
        TestNG["TestNG Runner"]:::test
        GetEmp["GetEmployee Test Class"]:::test
        RestAss["RestAssured Library"]:::test
    end

    subgraph "External Service"
        API["External REST API\n(dummy.restapiexample.com)"]:::external
    end

    subgraph "Reporting Pipeline"
        AllureRes["Allure Results Store\n(target/allure-results)"]:::report
        AllurePlugin["Allure Maven Plugin"]:::report
        HTMLReport["Allure HTML Report\n(target/site/allure-maven-plugin)"]:::report
    end

    Maven -->|"invokes"| TestNG
    TestNG -->|"loads test class"| GetEmp
    GetEmp -->|"calls HTTP GET"| RestAss
    RestAss -->|"HTTP GET"| API
    API -->|"HTTP response"| RestAss
    RestAss -->|"asserts & returns"| TestNG
    TestNG -->|"writes results"| AllureRes
    AllureRes -->|"reads results"| AllurePlugin
    AllurePlugin -->|"generates HTML"| HTMLReport

    click Maven "https://github.com/oktaliem/restassuredalluretestng/blob/master/pom.xml"
    click README "https://github.com/oktaliem/restassuredalluretestng/blob/master/README.md"
    click TestNG "https://github.com/oktaliem/restassuredalluretestng/blob/master/pom.xml"
    click RestAss "https://github.com/oktaliem/restassuredalluretestng/blob/master/pom.xml"
    click GetEmp "https://github.com/oktaliem/restassuredalluretestng/blob/master/src/test/java/com/oktaliem/GetEmployee.java"
    click AllurePlugin "https://github.com/oktaliem/restassuredalluretestng/blob/master/pom.xml"

    classDef build fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef test fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#FFB6C1,stroke:#000,stroke-width:1px
    classDef report fill:#FFA500,stroke:#000,stroke-width:1px
```
