Rest Assured Skill
1. Start
- Classify the request before writing files.
- Use
bootstrap/SKILL.mdfor new modules, missing dependencies, or missing test structure. - Use
orchestrator/SKILL.mdwhen the user asks for generic testing help and has not chosen planning, implementation, documentation, or reporting. - Use
core/SKILL.mdfor Rest Assured implementation, assertions, auth, specs, DTOs, JUnit 5 structure, and execution. - Use
virtualization/SKILL.mdfor WireMock, fault injection, or downstream API simulation. - Use
analysis/requirements/SKILL.mdfor epics, stories, acceptance criteria, or prose requirements. - Use
analysis/contracts/SKILL.mdfor OpenAPI or Swagger. - Use
analysis/contracts-soap/SKILL.mdfor WSDL or SOAP contract analysis. - Use
coverage_plan/generation/SKILL.mdto turn approved requirements and contracts into scenarios. - Use
coverage_plan/review/SKILL.mdto request user approval before implementation. - Use
documentation/skills for TDD, BDD, plain-text, mixed or absent narrative documentation, documentation sync, code docs, root-cause writeups, traceability reports, coverage-gap reports, OpenAPI change-impact reports, assertion-strength reports, bundled report regeneration, contract-mismatch notes, session-state tracking, or handover. - Use
ci/SKILL.mdfor GitHub Actions, GitLab, Docker, tagging, parallelization, and artifacts. - Use
C:\projects\skills\test-artifact-export-skill\SKILL.mdfor narrative test-case formatting and export artifacts. - Use
mappers/,reporters/, andreporting/stakeholder/for execution reporting and stakeholder workflows. - Prefer canonical narrative docs under
docs/tests/<feature>/; keepdocs/testing/for reports, indexes, and generated human-readable portals.
1a. Dispatcher Integration
Use skill-dispatcher as the primary integration layer whenever this skill family needs help from another skill or when a broader orchestrator is deciding whether Rest Assured is the right execution layer.
- Prefer dispatcher-led routing by intent, especially for
implement_api_confirmation_test,plan_api_test_coverage,render_test_artifact, andreport_api_test_results. - Prefer the repository's native API test stack over a new Rest Assured introduction when repo evidence points elsewhere.
- Treat direct paths to sibling skills as a compatibility fallback, not as the primary integration contract.
- Keep shared-memory usage limited to stable cross-project policy supplied externally, never task-local routing state.
2. Golden Rules
- Inspect
pom.xml,build.gradle,build.gradle.kts, and CI files before choosing dependency versions. - Default to JUnit 5 for new work unless the repository already standardizes on TestNG.
- Prefer reusable
RequestSpecificationandResponseSpecificationobjects over duplicatedgiven()chains. - Assert status, headers, body semantics, and error payloads; do not stop at status code checks.
- Create test data per test or per fixture; do not rely on execution order.
- Log on failure and redact tokens, cookies, API keys, and personal data.
- Use Testcontainers for dependencies owned by the system under test.
- Use WireMock only for third-party or unstable dependencies that must be simulated.
- Merge business requirements with API contracts before finalizing scenario coverage.
- When a live service is available, prefer runtime-observed assertions over contract assumptions and record any mismatch explicitly.
- Refuse placeholder tests, fake assertions, and undocumented assumptions.
- Keep one canonical narrative artifact per executable scenario whenever the repo uses TDD or plain-text cases.
- Use aggregate files under
docs/testing/only as indexes or report entry points when scenario-level files exist.
3. Read Only What You Need
- Read capability-map.md when you need a routing shortcut.
- Read version-compatibility.md when Java or Rest Assured version selection is unclear.
- Read family-conventions.md when naming, directory, or tagging conventions are needed.
- Read release-checklist.md when preparing the skill family for publishing.
4. Examples
- Input:
Create Rest Assured smoke tests for the order API from this OpenAPI file.Output: Useanalysis/contracts, thencoverage_plan/generation, thencore. - Input:
Set up a Maven JUnit 5 Rest Assured module in this repo.Output: Usebootstrap. - Input:
Document the approved API scenarios as BDD and export them for Xray.Output: Dispatchrender_test_artifactthroughskill-dispatcher, then fall back toC:\projects\skills\test-artifact-export-skill\SKILL.mdwhen needed. - Input:
The suite fails in CI only when the payment provider is down.Output: Usevirtualization,ci, anddocumentation/root_cause. - Input:
Create a resumable checkpoint so another agent can continue tomorrow.Output: Usedocumentation/session-state. - Input:
The live API does not match OpenAPI. Document the gaps.Output: Usedocumentation/contract-mismatches. - Input:
Show which tests cover each endpoint and method.Output: Usedocumentation/traceability-report. - Input:
Show the biggest API coverage gaps.Output: Usedocumentation/coverage-gap-report. - Input:
Compare these two API contracts and tell me which tests are affected.Output: Usedocumentation/openapi-change-impact-report. - Input:
Tell me which Rest Assured tests are weak or only assert status codes.Output: Usedocumentation/assertion-strength-report. - Input:
Refresh the full human-readable reporting set for this API module.Output: Usedocumentation/report-bundle. - Input:
Check whether the TDD, BDD, or plain-text case files drifted away from the tests.Output: Usedocumentation/documentation-sync. - Input:
Document the approved owner API scenarios as TDD.Output: Dispatchrender_test_artifactthroughskill-dispatcherand write one canonical file per scenario underdocs/tests/owner/.
5. Troubleshooting
- Problem: The user asks for generic API testing help with no scope.
Fix: Use
orchestrator/SKILL.mdand force the user goal into planning, implementation, execution, documentation, or reporting. - Problem: The repository mixes Java 11 and Java 17 modules.
Fix: Read
references/version-compatibility.mdand choose per-module compatibility instead of forcing one global version. - Problem: The request mixes user stories and OpenAPI input.
Fix: Run both analysis skills and merge the result in
coverage_plan/generation. - Problem: The live service contradicts the contract.
Fix: Keep the tests aligned with observed runtime behavior and create a mismatch artifact with
documentation/contract-mismatches. - Problem: The skill family needs a publish-readiness check before release.
Fix: Run
python scripts/validate_skill_family.py. - Problem: The mapping report points to aggregate documentation files instead of scenario-level artifacts.
Fix: Move canonical narrative docs into
docs/tests/<feature>/and update traceability to point to the scenario files, not only the index.
6. Gotchas
- Static Pollution:
RestAssured.baseURI,port, andconfigare static and persist across tests. Always reset them in@AfterEachor useRequestSpecificationobjects to avoid leaking state between test classes. - Missing Content-Type: Passing a DTO (POJO) to
.body()does not automatically setContent-Type: application/json. Explicitly set the format via.contentType(ContentType.JSON)to avoid415 Unsupported Media Typeerrors. - Logging Sensitive Data:
.log().all()captures everything, including Authorization headers and tokens. Use.log().ifValidationFails()or custom filters to redact sensitive information in CI/CD logs. - Hamcrest Matcher Conflicts:
org.hamcrest.Matcherscontains many common method names. Be careful with static imports if using other assertion libraries like AssertJ to avoid compilation errors or confusing IDE suggestions. - JSON Path vs XML Path: Rest Assured uses different GPath-like syntaxes for JSON and XML. A valid JSON path expression may not work for XML and vice-versa.
- Path Parameters Ordering: When using unnamed path parameters (e.g.,
.get("/{id}/{name}", 123, "test")), the order is strict. Prefer named path parameters for clarity and robustness.