# API mocking task requirements

Task and application assertion:
Required boundary (function / wrapper / HTTP / state):
Meaningful inputs and the pair that must produce different outcomes:
Safe input, starting state, isolation and reset:
Hard deployment / data constraints (see https://gostly.ai/security):
Ordinary adequate comparator and why it could suffice:
Candidate / version / configuration / date / proof source:
Observed result: PASS / FAIL / INCONCLUSIVE, with actual evidence:
Missing proof and the check that would resolve it:
Maintenance owner and import / redaction / reset / refresh effort:
Decision: KEEP / SWITCH / STOP, reason and next assertion:

## Four filled decision plans

These are authored plans. Record actual pass, fail or inconclusive results
before treating a candidate as adequate. Official documentation was checked
on 27 October 2026: WireMock Java/OSS and Postman saved-example mocks.

### Show one known order correctly

Task / assertion: The client parses a reviewed order response and displays the expected order state.

Ordinary adequate route: A local response fixture is adequate for a formatter or view test. Keep the existing test runner.

Required boundary: Add HTTP when routing, request selection, response parsing or SDK behavior is part of the assertion.

Conditional shortlist: For HTTP, shortlist a WireMock Java/OSS fixed mapping, an intentionally selected Postman saved example, or an imported response in a Gostly service library.

Discriminating check: Pair the intended order with a wrong ID or another meaningful input. Reject a setup that returns or accepts the same successful case for both.

Evidence to retain: Plan: use the shared fixed-response comparison and consumer regression packet; record the actual request, parsed fields and client result.

Operating ownership: The test owner maintains the fixture and assertions; an HTTP choice also needs matching, service routing and deployment ownership.

Planned decision: Keep the local fixture if it proves the assertion. Test an HTTP candidate only for the additional boundary you need.

Continue: [Inspect the shared HTTP task](https://gostly.ai/compare/wiremock); [Use the consumer regression packet](https://gostly.ai/docs/record-and-replay/reproduce-client-bug)

Documentation: [WireMock mappings](https://wiremock.org/docs/stubbing/); [Postman examples](https://learning.postman.com/docs/use/send-requests/response-data/examples); [Saved-example matching](https://learning.postman.com/docs/design-apis/mock-apis/matching-algorithm/); [Saved-example configuration](https://learning.postman.com/docs/design-apis/mock-apis/set-up-mock-servers)

### Cancel an order, then read the changed state

Task / assertion: Create, read, cancel and read again using the actual returned resource ID.

Ordinary adequate route: A response queue or authored state fixture can cover a fixed trace. Reset its cursor and client state between runs.

Required boundary: Use an HTTP state model when the clients or routing under test need it; define resource identity, isolation and reset explicitly.

Conditional shortlist: WireMock scenarios offer explicit states and reset for an authored finite trace. A configured Gostly resource/statechart is another candidate, with client reset owned separately.

Discriminating check: The first read is pending; the later read is cancelled for the same ID. Under the authored policy, repeated cancel is refused. Cancel A while B stays pending, then reset and reject stale-ID or leaked-state success.

Evidence to retain: Plan: adapt the stateful guide’s negative control. Independent successful responses must fail the later-read assertion; record response origin where the model requires it.

Operating ownership: The scenario owner maintains transitions, invalid actions, fixture IDs, reset and parallel-test isolation.

Planned decision: Keep a queue for the fixed trace if adequate. Switch to an explicit state model when alternate actions or independent resources are required.

Continue: [Plan the stateful trace](https://gostly.ai/docs/statecharts/order-lifecycle); [Develop the stateful workflow](https://gostly.ai/guides/stateful-api-testing)

Documentation: [WireMock scenario states and reset](https://wiremock.org/docs/stateful-behaviour/)

### Keep the response that exposed a client bug

Task / assertion: The same safe failure case rejects the old client and accepts the fix without breaking a normal control.

Ordinary adequate route: A retained response file and the existing test runner can be enough for a consumer regression.

Required boundary: Add HTTP for routing, SDK behavior or a shared service case. Prepare, sanitize and verify any captured input before retaining it.

Conditional shortlist: WireMock recording/snapshotting or a reviewed Gostly service library can supply HTTP cases. A Postman example can also be saved from a response.

Discriminating check: Run unchanged assertions against old and fixed clients, plus a normal response and malformed or wrong-ID control. Reject a fix that merely hides every error.

Evidence to retain: Plan: reuse the downloadable broken/fixed consumer packet. Its reader check and a captured HTTP replay establish different boundaries.

Operating ownership: Name the owner for capture permissions, redaction review, case coverage and deliberate refresh. A retained case does not track today’s upstream automatically.

Planned decision: Keep the file for the consumer bug. Evaluate HTTP replay only when its additional path is necessary to reproduce the failure.

Continue: [Use the consumer regression packet](https://gostly.ai/docs/record-and-replay/reproduce-client-bug)

Documentation: [WireMock recording and snapshotting](https://wiremock.org/docs/record-playback/); [Saving a Postman example](https://learning.postman.com/docs/use/send-requests/response-data/examples)

### Keep an unavailable tool distinct from a missing order

Task / assertion: The wrapper and agent preserve unavailable versus not-found results and take the permitted action.

Ordinary adequate route: A typed tool-result stub is adequate for answer-policy behavior; a transport stub can exercise the wrapper decoder.

Required boundary: Add HTTP only when status decoding, routing, SDK attempts or deadlines are part of this case.

Conditional shortlist: Keep the existing agent and evaluation harness. If HTTP is required, a Pro Gostly HTTP environment can supply the chosen dependency response; MCP is not required.

Discriminating check: Deliver 503 and 404 separately: require unavailable versus not-found. Inspect the actual wrapper result, attempt trace and actions against the task rubric.

Evidence to retain: Plan: use the existing test card and decoder as inputs. A decoder check alone does not establish an agent outcome or automatic score.

Operating ownership: The tool owner maintains result types and retry limits; the evaluator owns the rubric, action observations and acceptable answer.

Planned decision: Keep the typed stub for policy checks. Test HTTP when the wrapper’s real transport path is the question; leave missing agent evidence inconclusive.

Continue: [Use the order-tool example and decoder](https://gostly.ai/docs/proxy-setup/agent-tool-example)
