mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-08-07 12:48:52 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84c32d5b2d | ||
|
|
d39f7c771f |
@@ -1,3 +1,7 @@
|
|||||||
|
# 2.14.0 (06 August 2026)
|
||||||
|
- [#1493](https://github.com/wiremock/WireMock.Net/pull/1493) - Fix #1492: Serialize WithClientIP matcher to Request.ClientIP [bug] contributed by [Bafyn](https://github.com/Bafyn)
|
||||||
|
- [#1492](https://github.com/wiremock/WireMock.Net/issues/1492) - `WithClientIP` matcher is lost / corrupted when a mapping is serialized [bug]
|
||||||
|
|
||||||
# 2.13.0 (19 July 2026)
|
# 2.13.0 (19 July 2026)
|
||||||
- [#1488](https://github.com/wiremock/WireMock.Net/pull/1488) - feat(xunit logging): TestOutputHelperWireMockLogger [feature] contributed by [Stepami](https://github.com/Stepami)
|
- [#1488](https://github.com/wiremock/WireMock.Net/pull/1488) - feat(xunit logging): TestOutputHelperWireMockLogger [feature] contributed by [Stepami](https://github.com/Stepami)
|
||||||
- [#1490](https://github.com/wiremock/WireMock.Net/pull/1490) - Fix: Fully respect configured custom admin path (merge PR #1483) [feature] contributed by [Copilot](https://github.com/apps/copilot-swe-agent)
|
- [#1490](https://github.com/wiremock/WireMock.Net/pull/1490) - Fix: Fully respect configured custom admin path (merge PR #1483) [feature] contributed by [Copilot](https://github.com/apps/copilot-swe-agent)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VersionPrefix>2.13.0</VersionPrefix>
|
<VersionPrefix>2.14.0</VersionPrefix>
|
||||||
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
|
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
|
||||||
<PackageProjectUrl>https://github.com/wiremock/WireMock.Net</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/wiremock/WireMock.Net</PackageProjectUrl>
|
||||||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
rem https://github.com/StefH/GitHubReleaseNotes
|
rem https://github.com/StefH/GitHubReleaseNotes
|
||||||
|
|
||||||
SET version=2.13.0
|
SET version=2.14.0
|
||||||
|
|
||||||
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels wontfix test question invalid doc duplicate example environment --version %version% --token %GH_TOKEN%
|
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels wontfix test question invalid doc duplicate example environment --version %version% --token %GH_TOKEN%
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
# 2.13.0 (19 July 2026)
|
# 2.14.0 (06 August 2026)
|
||||||
- #1488 feat(xunit logging): TestOutputHelperWireMockLogger [feature]
|
- #1493 Fix #1492: Serialize WithClientIP matcher to Request.ClientIP [bug]
|
||||||
- #1490 Fix: Fully respect configured custom admin path (merge PR #1483) [feature]
|
- #1492 `WithClientIP` matcher is lost / corrupted when a mapping is serialized [bug]
|
||||||
- #1482 WireMock.Minimal.Owin does not respect custom pathing for determining admin paths [bug]
|
|
||||||
|
|
||||||
The full release notes can be found here: https://github.com/wiremock/WireMock.Net/blob/master/CHANGELOG.md
|
The full release notes can be found here: https://github.com/wiremock/WireMock.Net/blob/master/CHANGELOG.md
|
||||||
@@ -342,7 +342,7 @@ internal class MappingConverter(MatcherMapper mapper)
|
|||||||
if (clientIPMatcher?.Matchers != null)
|
if (clientIPMatcher?.Matchers != null)
|
||||||
{
|
{
|
||||||
var clientIPMatchers = _mapper.Map(clientIPMatcher.Matchers);
|
var clientIPMatchers = _mapper.Map(clientIPMatcher.Matchers);
|
||||||
mappingModel.Request.Path = new ClientIPModel
|
mappingModel.Request.ClientIP = new ClientIPModel
|
||||||
{
|
{
|
||||||
Matchers = clientIPMatchers,
|
Matchers = clientIPMatchers,
|
||||||
MatchOperator = clientIPMatchers?.Length > 1 ? clientIPMatcher.MatchOperator.ToString() : null
|
MatchOperator = clientIPMatchers?.Length > 1 ? clientIPMatcher.MatchOperator.ToString() : null
|
||||||
|
|||||||
@@ -155,7 +155,8 @@ public partial class WireMockServer
|
|||||||
var clientIPModel = _settings.DefaultJsonSerializer.ParseJsonToken<ClientIPModel>(requestModel.ClientIP);
|
var clientIPModel = _settings.DefaultJsonSerializer.ParseJsonToken<ClientIPModel>(requestModel.ClientIP);
|
||||||
if (clientIPModel.Matchers != null)
|
if (clientIPModel.Matchers != null)
|
||||||
{
|
{
|
||||||
requestBuilder = requestBuilder.WithPath(clientIPModel.Matchers.Select(_matcherMapper.Map).OfType<IStringMatcher>().ToArray());
|
var matchOperator = StringUtils.ParseMatchOperator(clientIPModel.MatchOperator);
|
||||||
|
requestBuilder = requestBuilder.WithClientIP(matchOperator, clientIPModel.Matchers.Select(_matcherMapper.Map).OfType<IStringMatcher>().ToArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
Guid: Guid_1,
|
||||||
|
UpdatedAt: DateTime_1,
|
||||||
|
Title: ,
|
||||||
|
Description: ,
|
||||||
|
Priority: 42,
|
||||||
|
Request: {
|
||||||
|
ClientIP: {
|
||||||
|
Matchers: [
|
||||||
|
{
|
||||||
|
Name: WildcardMatcher,
|
||||||
|
Pattern: 1.2.3.4,
|
||||||
|
IgnoreCase: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
Path: {
|
||||||
|
Matchers: [
|
||||||
|
{
|
||||||
|
Name: WildcardMatcher,
|
||||||
|
Pattern: /foo,
|
||||||
|
IgnoreCase: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Response: {},
|
||||||
|
UseWebhooksFireAndForget: false
|
||||||
|
}
|
||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
Description: ,
|
Description: ,
|
||||||
Priority: 42,
|
Priority: 42,
|
||||||
Request: {
|
Request: {
|
||||||
Path: {
|
ClientIP: {
|
||||||
Matchers: [
|
Matchers: [
|
||||||
{
|
{
|
||||||
Name: WildcardMatcher,
|
Name: WildcardMatcher,
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
Description: ,
|
Description: ,
|
||||||
Priority: 42,
|
Priority: 42,
|
||||||
Request: {
|
Request: {
|
||||||
Path: {
|
ClientIP: {
|
||||||
Matchers: [
|
Matchers: [
|
||||||
{
|
{
|
||||||
Name: WildcardMatcher,
|
Name: WildcardMatcher,
|
||||||
|
|||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
Guid: Guid_1,
|
||||||
|
UpdatedAt: DateTime_1,
|
||||||
|
Request: {
|
||||||
|
ClientIP: {
|
||||||
|
Matchers: [
|
||||||
|
{
|
||||||
|
Name: WildcardMatcher,
|
||||||
|
Pattern: 1.2.3.4,
|
||||||
|
IgnoreCase: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
Path: {
|
||||||
|
Matchers: [
|
||||||
|
{
|
||||||
|
Name: WildcardMatcher,
|
||||||
|
Pattern: /foo,
|
||||||
|
IgnoreCase: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Response: {
|
||||||
|
StatusCode: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -6,6 +6,7 @@ using WireMock.Models;
|
|||||||
using WireMock.RequestBuilders;
|
using WireMock.RequestBuilders;
|
||||||
using WireMock.ResponseBuilders;
|
using WireMock.ResponseBuilders;
|
||||||
using WireMock.Serialization;
|
using WireMock.Serialization;
|
||||||
|
using WireMock.Server;
|
||||||
using WireMock.Settings;
|
using WireMock.Settings;
|
||||||
using WireMock.Types;
|
using WireMock.Types;
|
||||||
using WireMock.Util;
|
using WireMock.Util;
|
||||||
@@ -376,6 +377,47 @@ message HelloReply {
|
|||||||
return Verify(model);
|
return Verify(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public Task ToMappingModel_Request_WithClientIP_And_Path_MapsClientIPToClientIPModel_NotPath()
|
||||||
|
{
|
||||||
|
// Arrange: a request that gates on BOTH ClientIP and Path.
|
||||||
|
var request = Request.Create().WithPath("/foo").WithClientIP("1.2.3.4");
|
||||||
|
var response = Response.Create();
|
||||||
|
var mapping = new Mapping(_guid, _updatedAt, string.Empty, string.Empty, null, _settings, request, response, 42, null, null, null, null, null, false, null, null);
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var model = _sut.ToMappingModel(mapping);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
model.Should().NotBeNull();
|
||||||
|
|
||||||
|
// Verify
|
||||||
|
return Verify(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public Task WithClientIP_And_Path_SurvivesMappingModelRoundTrip_AsClientIPMatcher()
|
||||||
|
{
|
||||||
|
// Arrange: a server with a mapping that gates on BOTH ClientIP and Path.
|
||||||
|
using var source = WireMockServer.Start();
|
||||||
|
source
|
||||||
|
.Given(Request.Create().WithPath("/foo").WithClientIP("1.2.3.4"))
|
||||||
|
.RespondWith(Response.Create().WithSuccess());
|
||||||
|
|
||||||
|
var models = source.MappingModels.ToArray();
|
||||||
|
models.Should().ContainSingle();
|
||||||
|
|
||||||
|
// Act
|
||||||
|
using var target = WireMockServer.Start();
|
||||||
|
target.WithMapping(models);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
var request = (Request)target.Mappings.Single(m => !m.IsAdminInterface).RequestMatcher;
|
||||||
|
|
||||||
|
// Verify
|
||||||
|
return Verify(target.MappingModels);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public Task ToMappingModel_Request_WithHeader_And_Cookie_ReturnsCorrectModel()
|
public Task ToMappingModel_Request_WithHeader_And_Cookie_ReturnsCorrectModel()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user