mock-integration-worker

Internal worker dispatched by software-engineer during DELIVER: resolves (strategy × stack) and emits the downstream mock wiring + integration-test scaffold — consumer-side only.

When active

Dispatched by software-engineer during the DELIVER phase when an integration test needs to mock a downstream HTTP or event dependency the SUT calls. Not user-invocable directly.

This worker is consumer-side: it replaces what the SUT calls. It does NOT produce a provider contract test — that is contract-testing-worker.

Inputs

Required:

Context:

Output

Structured result block returned to the lead — no commit:

status: ok
capability: mocking
strategy: microcks | inprocess
stack: dotnet
library: fakeiteasy | nsubstitute | moq   # only when strategy == inprocess
files:
  - <relative paths created>
testCommand: <resolved test command>
notes: <one line — what was mocked and how it is wired>

Workflow

  1. Load mocking-strategy-roster — resolve (strategy × stack) via cascade (prompt > skraft.instructions.md testing.mocking.* > default microcks)
  2. On blocker (unknown strategy/library/unsupported stack): return the roster’s blocked payload verbatim
  3. Load the resolved mocking-{strategy}-{stack} adapter and emit the mock wiring + test scaffold
  4. Resolve the test command via resolving-stack-commands
  5. Return the structured result to the lead

Invariants

Why this shape

Separating the worker (mock wiring) from the lead (business TDD) keeps each responsibility at its natural scope. The lead verifies the mock is called correctly in the TDD loop without delegating the routing decision to the worker.

« Start with a failing test that describes the behaviour you want, guided by tests from the outside in. » — Freeman, S. & Pryce, N., Growing Object-Oriented Software, Guided by Tests, 2009.

See also