mocking-strategy-roster

Two orthogonal axes — strategy (microcks inprocess) × stack: the single place that resolves how a downstream dependency is mocked for an integration test.

When to use

Entry contract

Exit contract

Invariants

Why this shape

Centralising the routing decision prevents each worker from encoding a mocking approach. The two axes (strategy and stack) are independent: a new stack plugs in without touching the strategy logic, and vice versa.

« Replace a component that the SUT depends on with a test-specific equivalent. » — Meszaros, G., xUnit Test Patterns, 2007.

Adapter table

Strategy Stack Adapter Status
microcks .NET mocking-microcks-dotnet supported
inprocess .NET mocking-inprocess-dotnet supported
microcks Java (mocking-microcks-java not yet provided) NOT SUPPORTED
inprocess Java (mocking-inprocess-java not yet provided) NOT SUPPORTED

Allowed customisation

See also