REST Assured API Testing Environment
Enterprise API testing with Java, REST Assured, TestNG, and Allure reporting.
What's Inside
| Tool | Version | Purpose |
|---|---|---|
| Java | OpenJDK 17 | Runtime |
| Maven | 3.9.9 | Build and dependency management |
| REST Assured | 5.5.1 | Fluent API testing library |
| TestNG | 7.10.2 | Test framework with groups and data providers |
| Allure | 2.29.1 | Rich test reporting |
| Jackson | 2.18.3 | JSON serialization/deserialization |
| Hamcrest | 3.0 | Expressive assertion matchers |
| Lombok | 1.18.36 | Boilerplate reduction |
Quick Start
# Run all tests
ra-run
# Run smoke tests only
ra-smoke
# Run tests + generate Allure report
ra-allure
# Scaffold a new project
ra-init my-api-tests
Helper Commands
| Command | What it does |
|---|---|
ra-run |
Run all tests (mvn test) |
ra-smoke |
Run @smoke group tests only |
ra-regression |
Run @regression group tests only |
ra-tag <group> |
Run tests by TestNG group name |
ra-allure |
Run tests + generate Allure report |
ra-report |
Serve existing Allure report |
ra-init <name> |
Scaffold a new REST Assured project |
ra-help |
Show all available commands |
Exercises
- REST Assured Fundamentals — GET, POST, PUT, DELETE with fluent BDD syntax
- CRUD Operations — End-to-end API lifecycle testing
- Authentication Testing — Bearer tokens, Basic auth, OAuth2 flows
- Request/Response Specifications — DRY principle with reusable specs
- JSON Schema Validation — Validate API response structure
- Data-Driven Testing — TestNG DataProvider for parameterized tests
- POJO Serialization — Java objects to/from JSON with Jackson
- CI/CD Integration — GitHub Actions pipeline with Allure reporting
Project Structure
workspace/
├── pom.xml # Maven config with all dependencies
├── testng.xml # TestNG suite (smoke, regression, all)
├── src/test/java/com/learncen/
│ ├── api/
│ │ ├── GetRequestTests.java # GET request examples
│ │ ├── CrudTests.java # Full CRUD lifecycle
│ │ └── AuthTests.java # Authentication tests
│ ├── models/
│ │ └── Post.java # POJO model
│ └── utils/
│ └── BaseTest.java # Shared RequestSpec/ResponseSpec
├── src/test/resources/
│ └── allure.properties
└── exercises/ # 8 guided exercises
Tips
- Use
given().when().then()BDD syntax for readable tests BaseTest.javasets up shared request/response specs — extend it for DRY tests- TestNG groups (
@Test(groups = "smoke")) let you run subsets withra-smokeorra-tag - Allure annotations (
@Epic,@Feature,@Story,@Severity) organize your report Ctrl+Shift+Bruns all tests from the IDE
Security
- Root access is restricted. Use
sudo apt install <package>for system packages. - Java and Maven are whitelisted for sudo access.
- JVM memory is auto-tuned to 75% of pod limits — no manual tuning needed.