Version 2.x (#1359)

* Version 2.x

* Setup .NET 9

* 12

* cleanup some #if for NETSTANDARD1_3

* cleanup + fix tests for net8

* openapi

* NO ConfigureAwait(false) + cleanup

* .

* #endif

* HashSet

* WireMock.Net.NUnit

* HttpContext

* Add WebSockets (#1423)

* Add WebSockets

* Add tests

* fix

* more tests

* Add tests

* ...

* remove IOwin

* -

* tests

* fluent

* ok

* match

* .

* byte[]

* x

* func

* func

* byte

* trans

* ...

* frameworks.........

* jmes

* xxx

* sc

* using var httpClient = new HttpClient();

* usings

* maxRetries

* up

* xunit v3

* ct

* ---

* ct

* ct2

* T Unit

* WireMock.Net.TUnitTests / 10

* t unit first

* --project

* no tunit

* t2

* --project

* --project

* ci -  --project

* publish ./test/wiremock-coverage.xml

* windows

* .

* log

* ...

* log

* goed

* BodyType

* .

* .

* --scenario

* ...

* pact

* ct

* .

* WireMock.Net.RestClient.AwesomeAssertions (#1427)

* WireMock.Net.RestClient.AwesomeAssertions

* ok

* atpath

* fix test

* sonar fixes

* ports

* proxy test

* FIX?

* ---

* await Task.Delay(100, _ct);

* ?

* --project

* Aspire: use IDistributedApplicationEventingSubscriber (#1428)

* broadcast

* ok

* more tsts

* .

* Collection

* up

* .

* 2

* remove nfluent

* <VersionPrefix>2.0.0-preview-02</VersionPrefix>

* ...

* .

* nuget icon

* .

* <PackageReference Include="JmesPath.Net" Version="1.1.0" />

* x

* 500

* .

* fix some warnings

* ws
This commit is contained in:
Stef Heyenrath
2026-03-11 17:02:47 +01:00
committed by GitHub
parent d6e19532bc
commit a292f28dda
521 changed files with 79740 additions and 5246 deletions

View File

@@ -2,8 +2,6 @@
// This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License.
// For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root.
using System;
using System.Collections.Generic;
using System.Net;
using Stef.Validation;
using WireMock.Matchers.Request;
@@ -25,6 +23,8 @@ internal class RespondWithAProvider : IRespondWithAProvider
private readonly IRequestMatcher _requestMatcher;
private readonly WireMockServerSettings _settings;
private readonly IDateTimeUtils _dateTimeUtils;
private readonly IGuidUtils _guidUtils;
private readonly bool _saveToFile;
private int _priority;
@@ -37,7 +37,7 @@ internal class RespondWithAProvider : IRespondWithAProvider
private int _timesInSameState = 1;
private bool? _useWebhookFireAndForget;
private double? _probability;
private GraphQLSchemaDetails? _graphQLSchemaDetails;
private GraphQLSchemaDetails? _graphQLSchemaDetails; // Future Use.
public Guid Guid { get; private set; }
@@ -49,16 +49,7 @@ internal class RespondWithAProvider : IRespondWithAProvider
public IdOrTexts? ProtoDefinition { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="RespondWithAProvider"/> class.
/// </summary>
/// <param name="registrationCallback">The registration callback.</param>
/// <param name="requestMatcher">The request matcher.</param>
/// <param name="settings">The WireMockServerSettings.</param>
/// <param name="guidUtils">GuidUtils to make unit testing possible.</param>
/// <param name="dateTimeUtils">DateTimeUtils to make unit testing possible.</param>
/// <param name="saveToFile">Optional boolean to indicate if this mapping should be saved as static mapping file.</param>
public RespondWithAProvider(
internal RespondWithAProvider(
RegistrationCallback registrationCallback,
IRequestMatcher requestMatcher,
WireMockServerSettings settings,
@@ -71,6 +62,8 @@ internal class RespondWithAProvider : IRespondWithAProvider
_requestMatcher = Guard.NotNull(requestMatcher);
_settings = Guard.NotNull(settings);
_dateTimeUtils = Guard.NotNull(dateTimeUtils);
_guidUtils = Guard.NotNull(guidUtils);
_saveToFile = saveToFile;
Guid = guidUtils.NewGuid();
@@ -79,6 +72,16 @@ internal class RespondWithAProvider : IRespondWithAProvider
/// <inheritdoc />
public void RespondWith(IResponseProvider provider)
{
if (provider is Response response && response.WebSocketBuilder != null)
{
// If the provider is a Response with a WebSocketBuilder, we need to use a WebSocketResponseProvider instead.
provider = new WebSocketResponseProvider(
response.WebSocketBuilder,
_guidUtils,
_dateTimeUtils
);
}
var mapping = new Mapping
(
Guid,