* Move ScenarioState to Abstractions and add IScenarioStateStore interface
ScenarioState is moved to the Abstractions project so it can be referenced
by the new IScenarioStateStore interface. The interface defines the contract
for storing and retrieving scenario states, enabling distributed implementations.
* Add InMemoryScenarioStateStore default implementation
Wraps ConcurrentDictionary with OrdinalIgnoreCase comparer, preserving
exact current behavior. The Update method encapsulates read-modify-write
so distributed implementations can make it atomic.
* Wire IScenarioStateStore into middleware options, settings, and consumers
Replace direct ConcurrentDictionary<string, ScenarioState> usage with
IScenarioStateStore across all consumer files. The store is injectable
via WireMockServerSettings.ScenarioStateStore, defaulting to the
InMemoryScenarioStateStore for backward compatibility.
* Add FileBasedScenarioStateStore for persistent scenario state
In-memory ConcurrentDictionary backed by JSON file persistence in
__admin/scenarios/. Reads from cache, mutations write through to disk.
Constructor loads existing state from disk on startup.
* Make ScenarioStateStore non-nullable with default InMemoryScenarioStateStore
Move InMemoryScenarioStateStore from WireMock.Net.Minimal to
WireMock.Net.Shared so it lives alongside WireMockServerSettings.
This allows WireMockServerSettings.ScenarioStateStore to be
non-nullable with a default value, following the same pattern as
DefaultJsonSerializer. The null-coalescing fallback in
WireMockMiddlewareOptionsHelper is no longer needed.
* Add helpers for query params
* add example with query params
* add fluent helpers for WithHeaders and WithCookies
---------
Co-authored-by: Logan Dam <Logan.Dam@rabobank.com>
Co-authored-by: Stef Heyenrath <Stef.Heyenrath@gmail.com>
* Update aspire to 13.1 (examples + code)
Allows usage of aspire CLI which is very useful for dev in codespaces (for my next PR).
* Add OTEL support
* Initial PR feedback
* PR feedback
* PR feedback
* PR feedback
* Cleanup.
* Cleanup
* Fix
* Fix
* Rename stuff around to be more accurate
* PR feedback
* Update WireMock.Net.OpenTelemetry.csproj
Update <Authors>
* PR feedback parser
* PR feedback package versions
* Status code feedback.
* Update preprocessor directives to to Activity Tracing instead of OpenTelemetry. Is more descriptive.
* Add tests
* Improve tests
---------
Co-authored-by: Stef Heyenrath <Stef.Heyenrath@gmail.com>
Pass AllowedHandlebarsHelpers configuration to Handlebars.Net.Helpers so that optional handlebars helpers can be enabled.
Co-authored-by: Sam Latham <sam.latham@citrix.com>
* Add property UseHttp2 to WireMockServerArguments
* .
* additionalUrls
* ok?
* WireMockServerArguments
* fx
* AddProtoDefinition
* ...
* FIX
* Always add the lifecycle hook to support dynamic mappings and proto definitions
* Add WireMockHealthCheck
For use with Aspire, to make WaitFor(wiremock) more useful.
Calls /__admin/health and checks the result, as well as checks if mappings using AdminApiMappingBuilder has been submitted to the server.
This created a catch-22 problem where the mappings were not submitted until the health check was healthy, but the health check was not healthy until the mappings were submitted.
To avoid this, the WireMockServerLifecycleHook class has been slightly re-arranged, and is now using the AfterEndpointsAllocatedAsync callback rather than the AfterResourcesCreatedAsync callback. Within which a separate Task is created that waits until the server is ready and submits the mappings.
* Move WireMockMappingState to its own file
* Dispose the cancellation tokens in WireMockServerLifecycleHook