QaaS.Mocker.Stubs
2.2.0
dotnet add package QaaS.Mocker.Stubs --version 2.2.0
NuGet\Install-Package QaaS.Mocker.Stubs -Version 2.2.0
<PackageReference Include="QaaS.Mocker.Stubs" Version="2.2.0" />
<PackageVersion Include="QaaS.Mocker.Stubs" Version="2.2.0" />
<PackageReference Include="QaaS.Mocker.Stubs" />
paket add QaaS.Mocker.Stubs --version 2.2.0
#r "nuget: QaaS.Mocker.Stubs, 2.2.0"
#:package QaaS.Mocker.Stubs@2.2.0
#addin nuget:?package=QaaS.Mocker.Stubs&version=2.2.0
#tool nuget:?package=QaaS.Mocker.Stubs&version=2.2.0
QaaS.Mocker
Configurable mock runtime for QaaS protocol workloads.
Contents
- Overview
- Packages
- Functionalities
- Protocol Support
- Quick Start
- Run the Example
- Runner Integration Overlay
- Build and Test
- Documentation
Overview
This repository contains one solution: QaaS.Mocker.sln.
QaaS.Mocker is published as a single NuGet package and composes internal runtime modules for stubs, protocol servers, and optional Redis controller operations.
Packages
| Package | Latest Version | Total Downloads |
|---|---|---|
| QaaS.Mocker |
Functionalities
QaaS.Mocker
- Parses CLI options and loads YAML configuration with overwrite files/arguments and optional environment resolution.
- Builds and validates execution context, data sources, stubs, one or more server runtimes, and optional controller runtime.
- Supports execution modes:
RunandTemplate.
QaaS.Mocker.Stubs
- Builds transaction stubs from configured processors and data source bindings.
- Executes request/response transformation through configurable serializer/deserializer pairs.
- Includes default status-code stubs for not-found and internal-error flows.
QaaS.Mocker.Servers
- Hosts protocol runtimes for
HTTP/HTTPS,gRPC/gRPCs, andSocket. - Routes actions/RPC methods to transaction stubs through state objects.
- Caches input/output payloads for controller consume operations.
QaaS.Mocker.Controller
- Initializes optional Redis-backed runtime controller when configured.
- Handles
PingandCommandchannels. - Supports runtime commands such as action-to-stub switch, trigger, and consume.
QaaS.Mocker.Example
- Provides runnable multi-server and transport-specific mocker configurations, sample processors, protobuf schema, and sample data assets.
Protocol Support
Supported protocol/runtime families in QaaS.Mocker:
| Family | Implementations |
|---|---|
| HTTP / RPC | HTTP, HTTPS, gRPC, gRPCs |
| Streaming / Socket | Socket (broadcast and collect modes) |
| Runtime Control | Redis-backed controller channels (ping and command) |
Quick Start
Install package:
dotnet add package QaaS.Mocker
Upgrade package:
dotnet add package QaaS.Mocker --version <target-version>
dotnet restore
Run the Example
The example uses relative paths for certificates, sample data, and socket payloads, so run it from QaaS.Mocker.Example. The example entry point also disables environment-variable overrides by default so IDE terminal variables do not rewrite the sample configuration.
- Open a terminal in the example directory.
Set-Location .\QaaS.Mocker.Example
- Create the development certificate expected by the sample HTTPS and gRPC configs.
dotnet dev-certs https -ep .\Certificates\devcert.pfx -p qaas-dev-cert
- Start the combined example. It boots HTTPS, gRPC with TLS, and a TCP socket collect endpoint from the same process.
dotnet run -- run mocker.qaas.yaml
- In a second terminal, call the HTTPS health endpoint.
curl.exe -k https://127.0.0.1:8443/health
- Call the gRPC endpoint from Git Bash, WSL, or another POSIX-style shell if you have
grpcurlinstalled.
grpcurl -insecure -import-path Protos -proto echo.proto -d '{"message":"hello"}' 127.0.0.1:50051 qaas.mocker.example.EchoService/Echo
- Send a payload to the socket collect endpoint. The socket endpoint does not reply; success is a clean connect and write plus a collect log entry in the server terminal.
$client = [System.Net.Sockets.TcpClient]::new()
$client.Connect('127.0.0.1', 7001)
$stream = $client.GetStream()
$payload = [System.Text.Encoding]::UTF8.GetBytes('socket-check')
$stream.Write($payload, 0, $payload.Length)
$stream.Flush()
$stream.Dispose()
$client.Dispose()
- Generate the effective combined configuration with the
templatecommand.
dotnet run -- template mocker.qaas.yaml
- If you still want the dedicated gRPC-only sample, it remains available.
dotnet run -- run mocker.grpc.qaas.yaml
Runner Integration Overlay
The example now includes mocker.runner.qaas.yaml, an overwrite file that appends only the runner-integration pieces missing from mocker.qaas.yaml:
- Redis controller configuration for runner mocker commands
- Alternate stubs for
ChangeActionStubchecks on HTTP, gRPC, and socket - A socket broadcast endpoint on port
6000forTriggerAction
The overlay uses explicit numeric indexes for list sections so it can be appended with --overwrite-files without editing the base sample.
Use it together with the base file instead of editing the base sample:
- Start local Redis:
docker run -d --name qaas-redis -p 6379:6379 redis:7-alpine
- Ensure the sample certificate exists:
Set-Location .\QaaS.Mocker.Example
dotnet dev-certs https -ep .\Certificates\devcert.pfx -p qaas-dev-cert
- Run the sample plus the overlay:
dotnet run -- run mocker.qaas.yaml --overwrite-files mocker.runner.qaas.yaml
The combined runtime exposes:
- HTTPS health endpoint on
https://127.0.0.1:8443/health - TLS gRPC endpoint on
127.0.0.1:50051 - TCP socket collect endpoint on
127.0.0.1:7001 - TCP socket broadcast endpoint on
127.0.0.1:6000 - Redis controller under server name
RunnerMockerExample
The broadcast endpoint is disabled by default and becomes active only when the runner sends TriggerAction for SocketBroadcastAction.
Build and Test
dotnet restore QaaS.Mocker.sln
dotnet build QaaS.Mocker.sln -c Release --no-restore
dotnet test QaaS.Mocker.sln -c Release --no-build
Documentation
- Official docs: thesmoketeam.github.io/qaas-docs
- CI workflow:
.github/workflows/ci.yml - NuGet package: QaaS.Mocker on NuGet
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Autofac (>= 9.1.0)
- QaaS.Framework.SDK (>= 1.4.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on QaaS.Mocker.Stubs:
| Package | Downloads |
|---|---|
|
QaaS.Mocker.Servers
Transport-specific HTTP, gRPC, and socket mock servers for QaaS.Mocker runtimes. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.0 | 0 | 3/31/2026 |
| 2.1.1 | 103 | 3/28/2026 |
| 2.1.0 | 49 | 3/25/2026 |
| 2.0.6 | 109 | 3/23/2026 |
| 2.0.6-alpha.1 | 38 | 3/22/2026 |
| 2.0.5 | 145 | 3/21/2026 |
| 2.0.5-alpha.4 | 37 | 3/22/2026 |
| 2.0.5-alpha.3 | 38 | 3/21/2026 |
| 2.0.5-alpha.1 | 36 | 3/21/2026 |
| 2.0.4 | 95 | 3/21/2026 |