# Restassured Virtualization

> Use when Codex needs to simulate downstream HTTP services for Rest Assured suites with WireMock, stub mappings, latency, retries, fault injection, or isolation from unstable third-party dependencies.

- Skill: `jovd83/restassured-virtualization` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add jovd83/restassured-virtualization`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jovd83/restassured-virtualization/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: jovd83 (https://skillmd.com/u/jovd83)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jovd83/restassured-virtualization

---


# Service Virtualization

## 1. Decide Whether To Mock

1. Mock only third-party or unstable dependencies.
2. Keep real dependencies for the system under test whenever practical.
3. Read [when-to-mock-vs-real.md](references/when-to-mock-vs-real.md) before adding stubs.

## 2. Create The Stub Layer

1. Use WireMock for HTTP downstream dependencies.
2. Model stable happy-path stubs first.
3. Add negative behavior only when the scenario requires it.
4. Read [wiremock-patterns.md](references/wiremock-patterns.md) for stub structure.

## 3. Inject Failure Modes

1. Add latency, resets, malformed payloads, and error statuses deliberately.
2. Read [fault-injection.md](references/fault-injection.md) before writing resilience tests.

## 4. Verify Intent

1. Assert that the system under test handled the dependency behavior correctly.
2. Assert that the stub was called only when interaction verification matters.

## 5. Examples

1. Input: `Simulate the shipping provider timing out.`
   Output: Add a WireMock delayed response and assert the API returns the documented fallback error.
2. Input: `Stub the tax provider for local CI.`
   Output: Add deterministic success and validation-failure stubs, then route the tests to the stub base URL.

## 6. Troubleshooting

1. Problem: The suite still calls the live dependency.
   Fix: Verify the service under test points to the stubbed base URL.
2. Problem: Contract drift breaks the stub.
   Fix: Rebuild the stub from the latest contract or response samples.
