Processors¶
Processors are hooks that create mock responses in QaaS.Mocker. They implement BaseTransactionProcessor<TConfig> and are referenced by class name from a Stub.
The QaaS.Common.Processors package is the reusable processor library for shared mock behavior. You can also author project-local processors when a mock needs behavior that is specific to one repository.
| Package | QaaS.Common.Processors |
| Source | QaaS.Common.Processors |
| Depends on | QaaS.Framework.SDK |
Installation¶
Writing a Custom Processor¶
See the Write Hooks guide for the local-hook pattern.
Quick-Start Note¶
The Mocker quick starts on this site keep the file-backed response processor inside the sample project so the examples stay runnable against the currently published NuGet packages.
Available Hooks¶
The built-in hooks below are grouped by usage area so it is easier to shortlist the right hook before drilling into configuration details.
Static responses¶
- StaticResponseProcessor: Returns a fixed UTF-8 response body with the configured status code, content type, and headers.
- StatusCodeTransactionProcessor: Skim Transaction Processor which returns empty-bodied data objects with Status Code configuration.
Request-derived responses¶
- RequestEchoProcessor: Returns a JSON response that echoes the incoming request body and optional request metadata.
- PassThroughProcessor: Returns the incoming request payload unchanged while applying the configured response metadata.
Transformations¶
- JsonEnvelopeProcessor: Wraps the incoming request payload and optional request metadata in a JSON envelope response.
- TextTransformProcessor: Reads the incoming payload as text, applies the configured text transformation, and returns the transformed response.
Data-driven responses¶
- ConditionalResponseProcessor: Returns the first configured response whose rule matches the incoming request metadata, or the configured default response when no rule matches.
- DataSourceResponseProcessor: Builds the response from generated data produced by one configured data source.
Error responses¶
- ProblemDetailsProcessor: Returns an RFC 7807 style problem-details JSON response using the configured status and fields.