Compare commits

..

4 Commits

Author SHA1 Message Date
Stef Heyenrath
05b5876b5c 1.8.10 2025-06-10 08:15:22 +02:00
Stef Heyenrath
c1bd2d315f Update AwesomeAssertions to version 9 (#1309) 2025-06-06 21:06:38 +02:00
Stef Heyenrath
8917a6eaaa For some projects, change dependency to WireMock.Net.Minimal (#1308) 2025-06-06 11:22:34 +02:00
Stef Heyenrath
3cc9040f51 Update RequestModelBuilder (add WithHeader) (#1306)
* Update RequestModelBuilder (add WithHeader)

* rejectOnMatch

* fix
2025-06-05 12:24:40 +02:00
13 changed files with 61 additions and 13 deletions

View File

@@ -1,3 +1,10 @@
# 1.8.10 (10 June 2025)
- [#1306](https://github.com/wiremock/WireMock.Net/pull/1306) - Update RequestModelBuilder (add WithHeader) [feature] contributed by [StefH](https://github.com/StefH)
- [#1308](https://github.com/wiremock/WireMock.Net/pull/1308) - For some projects, change dependency to WireMock.Net.Minimal [feature] contributed by [StefH](https://github.com/StefH)
- [#1309](https://github.com/wiremock/WireMock.Net/pull/1309) - Update AwesomeAssertions to version 9 [feature] contributed by [StefH](https://github.com/StefH)
- [#1305](https://github.com/wiremock/WireMock.Net/issues/1305) - AdminApiMappingBuilder do not expose WithHeader for Request [feature]
- [#1307](https://github.com/wiremock/WireMock.Net/issues/1307) - Update WireMock.Net.AwesomeAssertions to use latest version from AwesomeAssertions [feature]
# 1.8.9 (28 May 2025)
- [#1303](https://github.com/wiremock/WireMock.Net/pull/1303) - Add option to provide X509Certificate [feature] contributed by [StefH](https://github.com/StefH)
- [#1302](https://github.com/wiremock/WireMock.Net/issues/1302) - Support In-Memory SSL Certificate [feature]

View File

@@ -4,7 +4,7 @@
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.8.9</VersionPrefix>
<VersionPrefix>1.8.10</VersionPrefix>
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
<PackageProjectUrl>https://github.com/wiremock/WireMock.Net</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

View File

@@ -1,6 +1,6 @@
rem https://github.com/StefH/GitHubReleaseNotes
SET version=1.8.9
SET version=1.8.10
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels wontfix test question invalid doc duplicate example environment --version %version% --token %GH_TOKEN%

View File

@@ -1,5 +1,8 @@
# 1.8.8 (28 May 2025)
- #1303 Add option to provide X509Certificate [feature]
- #1302 Support In-Memory SSL Certificate [feature]
# 1.8.10 (10 June 2025)
- #1306 Update RequestModelBuilder (add WithHeader) [feature]
- #1308 For some projects, change dependency to WireMock.Net.Minimal [feature]
- #1309 Update AwesomeAssertions to version 9 [feature]
- #1305 AdminApiMappingBuilder do not expose WithHeader for Request [feature]
- #1307 Update WireMock.Net.AwesomeAssertions to use latest version from AwesomeAssertions [feature]
The full release notes can be found here: https://github.com/wiremock/WireMock.Net/blob/master/CHANGELOG.md

View File

@@ -138,4 +138,27 @@ public partial class RequestModelBuilder
return builder.Build();
});
}
/// <summary>
/// WithHeader: matching based on name, pattern and matchBehaviour.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="pattern">The pattern.</param>
/// <param name="rejectOnMatch">The match behaviour. Default value is <c>false</c>.</param>
/// <returns>The <see cref="RequestModelBuilder"/>.</returns>
public RequestModelBuilder WithHeader(string name, string pattern, bool rejectOnMatch = false)
{
return WithHeaders(headersBuilder => headersBuilder
.Add(headerBuilder => headerBuilder
.WithName(name)
.WithMatchers(matchersBuilder => matchersBuilder
.Add(matcherBuilder => matcherBuilder
.WithName("WildcardMatcher")
.WithPattern(pattern)
.WithRejectOnMatch(rejectOnMatch)
)
)
)
);
}
}

View File

@@ -42,7 +42,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WireMock.Net\WireMock.Net.csproj" />
<ProjectReference Include="..\WireMock.Net.Minimal\WireMock.Net.Minimal.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,6 +1,6 @@
// Copyright © WireMock.Net
using FluentAssertions.Primitives;
using AwesomeAssertions.Primitives;
using WireMock.Server;
// ReSharper disable once CheckNamespace

View File

@@ -1,5 +1,5 @@
// Copyright © WireMock.Net
global using System.Linq;
global using FluentAssertions;
global using FluentAssertions.Execution;
global using AwesomeAssertions;
global using AwesomeAssertions.Execution;

View File

@@ -32,11 +32,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AwesomeAssertions" Version="8.1.0" />
<PackageReference Include="AwesomeAssertions" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WireMock.Net\WireMock.Net.csproj" />
<ProjectReference Include="..\WireMock.Net.Minimal\WireMock.Net.Minimal.csproj" />
</ItemGroup>
</Project>

View File

@@ -40,7 +40,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WireMock.Net\WireMock.Net.csproj" />
<ProjectReference Include="..\WireMock.Net.Minimal\WireMock.Net.Minimal.csproj" />
</ItemGroup>
</Project>

View File

@@ -34,7 +34,7 @@
<Target Name="CheckIfShouldKillVBCSCompiler" />
<ItemGroup>
<ProjectReference Include="..\WireMock.Net\WireMock.Net.csproj" />
<ProjectReference Include="..\WireMock.Net.Minimal\WireMock.Net.Minimal.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' or '$(TargetFramework)' == 'net452' ">

View File

@@ -15,6 +15,19 @@
Methods: [
POST
],
Headers: [
{
Name: Authorization,
Matchers: [
{
Name: WildcardMatcher,
Pattern: *,
IgnoreCase: false,
RejectOnMatch: true
}
]
}
],
Body: {
Matcher: {
Name: JsonPartialMatcher,

View File

@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using FluentAssertions;
using VerifyTests;
using VerifyXunit;
using WireMock.Admin.Mappings;
using WireMock.Client;
using WireMock.Client.Extensions;
using WireMock.Net.Tests.VerifyExtensions;
@@ -41,6 +42,7 @@ public class AdminApiMappingBuilderTests
.WithRequest(req => req
.UsingPost()
.WithPath("/bla1")
.WithHeader("Authorization", "*", true)
.WithBody(body => body
.WithMatcher(matcher => matcher
.WithName("JsonPartialMatcher")