An autonomous AI API testing platform that parses OpenAPI specifications, uses GenAI (Spring AI + Ollama / LLM) to synthesize structured test suites across positive, negative, and boundary scenarios, executes tests against real endpoints, performs deterministic contract validation, and provides automated failure root-cause analysis.
flowchart TD
User([Developer / Browser]) -->|HTTP / UI| Frontend[React SPA - Vite + JavaScript]
Frontend -->|REST API| Backend[Spring Boot 3.3.4 Backend]
subgraph Core Engine
Backend -->|Ingest Spec| Parser[OpenAPI 3.x Parser Service]
Parser -->|Normalized Contract DTO| AI[Spring AI Engine - Ollama llama3.2]
AI -->|Structured JSON Test Suite| Runner[Async HTTP Test Runner]
Runner -->|Concurrent Requests| TargetAPI[(Target API Under Test)]
TargetAPI -->|Actual Response| Validator[Contract Validator Engine]
Validator -->|Deterministic Assertions| Diagnostic{Violation Found?}
Diagnostic -->|Yes| RootCause[AI Root-Cause Diagnosis]
Diagnostic -->|No| Success[Pass Record]
end
RootCause --> Storage[(PostgreSQL / H2 DB)]
Success --> Storage
Storage -->|Live Telemetry| Frontend
The repository includes automated continuous integration configured via GitHub Actions.
- Workflow File:
.github/workflows/ci.yml - Status Link: View the live status by navigating to the Actions tab of your repository:
https://github.com/<YOUR_USERNAME>/<YOUR_REPO>/actions/workflows/ci.yml
| Job | Environment | Execution Steps |
|---|---|---|
| Backend Build & Test | ubuntu-latest |
1. Checks out repository source code 2. Sets up Eclipse Temurin JDK 21 3. Restores and caches Maven dependencies 4. Runs mvn clean test -B using in-memory H2 profile |
| Frontend Build | ubuntu-latest |
1. Checks out repository source code 2. Sets up Node.js 20 environment 3. Restores and caches npm packages 4. Executes npm install and npm run build (Vite production bundle) |
-
Autonomous OpenAPI Contract Ingestion:
- Parses raw OpenAPI 3.0 and 3.1 specifications in JSON or YAML.
- Normalizes complex nested schemas into compact
ApiContractDtomodels to reduce LLM prompt token consumption.
-
Multi-Category Test Case Synthesis:
- Prompts local LLMs (Ollama
llama3.2) or cloud providers via Spring AI'sChatClientabstraction. - Automatically generates structured JSON test suites covering:
- Positive Scenarios: Happy-path requests verifying status codes and required payload responses.
- Negative Scenarios: Unauthorized, malformed, or missing field tests asserting expected 4xx errors.
- Boundary & Edge Scenarios: Min/max integer extremes, boundary strings, empty arrays, and special characters.
- Prompts local LLMs (Ollama
-
Deterministic Contract Validation:
- Compares actual live HTTP responses against OpenAPI specifications strictly through deterministic code:
- Exact HTTP status code validation.
- JSON Schema type conformity and structure validation.
- Required field presence assertion.
- Response header and
Content-Typematching.
- Compares actual live HTTP responses against OpenAPI specifications strictly through deterministic code:
-
High-Performance Async Test Execution:
- Dispatches concurrent HTTP test calls via configurable thread pools.
- Built-in request timeout limits and response body truncation to protect against memory exhaustion.
-
SSRF & Outbound Security Guard:
SsrfProtectionServiceintercepts and validates all outbound target URLs.- Blocks cloud instance metadata services (
169.254.169.254), loopback probing in restricted modes, and enforces domain allowlists.
-
AI Failure Diagnostics & Root-Cause Triage:
- When a test fails or a contract violation is detected, the raw failure context is dispatched to the AI diagnostic engine.
- Produces a clear natural-language explanation, likely root-cause hypothesis, severity rating, and suggested code fix.
-
Interactive Built-In Defect Demo:
- Built-in
/demo/usersendpoints pre-seeded with real contract defects:- Status code defect:
POST /demo/usersreturns HTTP 200 instead of 201. - Missing schema field:
PUT /demo/users/{id}omitsupdatedAt.
- Status code defect:
- Built-in
-
CI/CD Breaking Change Gatekeeper: Run this agent in your staging or release pipeline to verify that recently merged code has not introduced unexpected schema drift, omitted fields, or undocumented status codes.
-
Zero-Effort Test Suite Generation: Teams inheriting legacy or rapidly evolving microservices can upload their OpenAPI specification and instantly produce comprehensive positive and negative test coverage without manual test scripting.
-
Defensive Boundary & Robustness Fuzzing: Discover unhandled edge cases by letting the LLM construct unusual payloads, out-of-range parameters, and malformed inputs that human testers often overlook.
-
Automated Root-Cause Triage for QA Engineers: Rather than parsing raw stack traces and JSON diffs, QA engineers receive plain-text explanations identifying whether a defect originated from an endpoint bug or an outdated API specification.
├── .github/
│ ├── workflows/ci.yml # CI pipeline workflow for Backend & Frontend
│ ├── ISSUE_TEMPLATE/ # Bug report & feature request issue templates
│ └── pull_request_template.md # Pull request checklist template
├── backend/ # Spring Boot 3.3.4 (Java 21) REST Service
│ ├── src/main/java/com/apitest/agent/
│ │ ├── ai/ # Spring AI & Ollama abstractions
│ │ ├── config/ # Async, CORS, SSRF & Jackson configurations
│ │ ├── controller/ # Project, TestRun, and Demo REST endpoints
│ │ ├── dto/ # Data Transfer Objects & API models
│ │ ├── exception/ # Global exception handling & custom errors
│ │ ├── executor/ # Concurrent HTTP test execution engine
│ │ ├── model/ # JPA persistence entities
│ │ ├── parser/ # OpenAPI specification normalization service
│ │ ├── repository/ # Spring Data JPA repositories
│ │ ├── service/ # Business orchestration services
│ │ ├── util/ # JSON & HTTP helper utilities
│ │ └── validator/ # Deterministic schema & contract validator
│ ├── src/main/resources/ # Application profiles (application.yml, local, test)
│ ├── src/test/ # Mock AI & integration test suites
│ ├── Dockerfile # Multi-stage production container build
│ ├── mvnw / mvnw.cmd # Maven wrappers for Linux/macOS and Windows
│ └── pom.xml # Maven build file
├── docs/
│ └── images/ # Architecture diagrams & SVG assets
├── frontend/ # React 18 + JavaScript + Vite SPA
│ ├── src/
│ │ ├── api/ # Axios HTTP client & API endpoints
│ │ ├── components/ # Status badges, AI badges, viewers, layout
│ │ ├── pages/ # Dashboard, project detail, test run detail
│ │ ├── App.jsx # React application router
│ │ ├── main.jsx # React DOM entry point
│ │ └── index.css # Global modern dark-theme styles
│ ├── Dockerfile # Production Nginx container build
│ ├── vite.config.js # Vite build & proxy settings
│ └── package.json # Frontend dependencies & build scripts
├── sample-data/ # Example OpenAPI specifications for testing
├── docker-compose.yml # Orchestration for PostgreSQL, Backend & Frontend
├── .env.example # Reference environment configuration
├── .gitignore # Comprehensive Git ignore rules
├── .gitattributes # Line ending and binary file definitions
├── .editorconfig # Code formatting standards across IDEs
├── CONTRIBUTING.md # Contribution workflow & commit standards
├── SECURITY.md # Security policy & reporting instructions
└── README.md # Project documentation
- JDK 21 or later
- Node.js 20+ & npm
- Ollama (with
llama3.2model pulled) or access to a cloud LLM - Docker & Docker Compose (optional)
-
Make sure Ollama is running on your host machine:
ollama serve ollama pull llama3.2
-
Copy environment settings:
cp .env.example .env
-
Launch all services:
docker compose up --build
-
Open the application:
- Frontend UI: http://localhost:3000
- Backend API: http://localhost:8080
- Swagger UI: http://localhost:8080/swagger-ui.html
ollama serve
ollama pull llama3.2cp .env.example .envRun a local PostgreSQL database on port 5432, or boot only the database via Docker:
docker compose up postgres -dcd backend
mvn spring-boot:runcd frontend
npm install
npm run devFrontend will be running at http://localhost:5173.
- Open the dashboard at
http://localhost:5173(orhttp://localhost:3000under Docker). - Click New Project:
- Name:
Demo User Service - Target API Base URL:
http://localhost:8080
- Name:
- In the OpenAPI Specification tab, upload
sample-data/sample-openapi.yaml. - Click Generate AI Tests to synthesize test scenarios.
- Click Execute Tests:
- The test runner executes HTTP requests against the live demo endpoints.
- The deterministic validator detects status code mismatches and omitted schema fields.
- The AI diagnostics panel displays root-cause explanations and remediation steps.
cd backend
mvn clean testcd frontend
npm run build| Environment Variable | Default Value | Description |
|---|---|---|
DATABASE_URL |
jdbc:postgresql://localhost:5432/api_testing |
JDBC database connection string |
DATABASE_USERNAME |
apitest |
Database user |
DATABASE_PASSWORD |
apitest |
Database password |
OLLAMA_BASE_URL |
http://localhost:11434 |
Ollama service endpoint |
OLLAMA_MODEL |
llama3.2 |
Local LLM model identifier |
APP_TESTING_DEMO_MODE |
false |
Enables strict target host restrictions |
APP_TESTING_ALLOWED_HOSTS |
|
Comma-separated allowed hostnames |
APP_DEMO_DEFECTS_ENABLED |
true |
Enables intentional defects in demo API |
CORS_ALLOWED_ORIGINS |
http://localhost:5173,http://localhost:3000 |
Allowed CORS origins |
This repository is distributed under the MIT License.