Skip to content

Commit 1da7316

Browse files
committed
mm
2 parents cb14de1 + 888d913 commit 1da7316

File tree

22 files changed

+452
-86
lines changed

22 files changed

+452
-86
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
steps:
3939
- uses: actions/checkout@v4
4040

41+
- name: Setup .NET 8
42+
uses: actions/setup-dotnet@v4
43+
with:
44+
dotnet-version: '8.0.x'
45+
4146
- name: 'WireMock.Net.Tests'
4247
run: dotnet test './test/WireMock.Net.Tests/WireMock.Net.Tests.csproj' -c Release --framework net8.0
4348

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 1.6.12 (21 January 2025)
2+
- [#1231](https://github.com/WireMock-Net/WireMock.Net/pull/1231) - Fix google protobuf WellKnownTypes: Empty, Duration and Timestamp [bug] contributed by [StefH](https://github.com/StefH)
3+
- [#1235](https://github.com/WireMock-Net/WireMock.Net/pull/1235) - Fix ArgumentException in FindLogEntries [bug] contributed by [StefH](https://github.com/StefH)
4+
- [#1241](https://github.com/WireMock-Net/WireMock.Net/pull/1241) - Upgrade to Handlebars.Net.Helpers 2.4.9 [bug] contributed by [StefH](https://github.com/StefH)
5+
- [#1227](https://github.com/WireMock-Net/WireMock.Net/issues/1227) - unable to call grpc method with namespace [bug]
6+
- [#1228](https://github.com/WireMock-Net/WireMock.Net/issues/1228) - how to set datetime for grpc field [bug]
7+
- [#1234](https://github.com/WireMock-Net/WireMock.Net/issues/1234) - FindLogEntries regression [bug]
8+
- [#1240](https://github.com/WireMock-Net/WireMock.Net/issues/1240) - Method 'get_Category' in type 'WireMock.Transformers.Handlebars.FileHelpers' [bug]
9+
110
# 1.6.11 (02 January 2025)
211
- [#1221](https://github.com/WireMock-Net/WireMock.Net/pull/1221) - Add overloads to AtUrl and AtAbsoluteUrl which can use a IStringMatcher [feature] contributed by [StefH](https://github.com/StefH)
312
- [#1222](https://github.com/WireMock-Net/WireMock.Net/pull/1222) - Fix WireMockContainerBuilder (duplicate entries) [bug] contributed by [StefH](https://github.com/StefH)

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</PropertyGroup>
55

66
<PropertyGroup>
7-
<VersionPrefix>1.6.11</VersionPrefix>
7+
<VersionPrefix>1.6.12</VersionPrefix>
88
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
99
<PackageProjectUrl>https://github.com/WireMock-Net/WireMock.Net</PackageProjectUrl>
1010
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

Generate-ReleaseNotes.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rem https://github.com/StefH/GitHubReleaseNotes
22

3-
SET version=1.6.11
3+
SET version=1.6.12
44

55
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels test question invalid doc duplicate example environment --version %version% --token %GH_TOKEN%
66

PackageReleaseNotes.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# 1.6.11 (02 January 2025)
2-
- #1221 Add overloads to AtUrl and AtAbsoluteUrl which can use a IStringMatcher [feature]
3-
- #1222 Fix WireMockContainerBuilder (duplicate entries) [bug]
4-
- #1223 Add functionality to call a PostTransform method after the Webhook request has been transformed [feature]
5-
- #1224 Add FindLogEntries to IWireMockServer [feature]
6-
- #1092 FindLogEntries present in WireMockServer but not IWireMockServer [feature]
7-
- #1192 Feature: add URL assertion excluding query parameters [feature]
8-
- #1204 Supplying Values From Request for Webhook Body and Headers [feature]
9-
- #1217 Order of WireMockContainerBuilder WithX calls caused duplicate Networks in Configuration [bug]
1+
# 1.6.12 (21 January 2025)
2+
- #1231 Fix google protobuf WellKnownTypes: Empty, Duration and Timestamp [bug]
3+
- #1235 Fix ArgumentException in FindLogEntries [bug]
4+
- #1241 Upgrade to Handlebars.Net.Helpers 2.4.9 [bug]
5+
- #1227 unable to call grpc method with namespace [bug]
6+
- #1228 how to set datetime for grpc field [bug]
7+
- #1234 FindLogEntries regression [bug]
8+
- #1240 Method 'get_Category' in type 'WireMock.Transformers.Handlebars.FileHelpers' [bug]
109

1110
The full release notes can be found here: https://github.com/WireMock-Net/WireMock.Net/blob/master/CHANGELOG.md
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright © WireMock.Net
22

3-
using JetBrains.Annotations;
43
using System.Collections.Generic;
54

65
namespace WireMock.Handlers;
@@ -21,91 +20,91 @@ public interface IFileSystemHandler
2120
/// </summary>
2221
/// <param name="path">The path.</param>
2322
/// <returns>true if path refers to an existing directory; false if the directory does not exist or an error occurs when trying to determine if the specified directory exists.</returns>
24-
bool FolderExists([NotNull] string path);
23+
bool FolderExists(string path);
2524

2625
/// <summary>
2726
/// Creates all directories and subdirectories in the specified path unless they already exist.
2827
/// </summary>
2928
/// <param name="path">The path.</param>
30-
void CreateFolder([NotNull] string path);
29+
void CreateFolder(string path);
3130

3231
/// <summary>
3332
/// Returns an enumerable collection of file names in a specified path.
3433
/// </summary>
3534
/// <param name="path">The path.</param>
36-
/// <param name="includeSubdirectories">A value indicating whether subdirectories should also included when enumerating files.</param>
35+
/// <param name="includeSubdirectories">A value indicating whether subdirectories should also be included when enumerating files.</param>
3736
/// <returns>An enumerable collection of the full names (including paths) for the files in the directory (and optionally subdirectories) specified by path.</returns>
38-
IEnumerable<string> EnumerateFiles([NotNull] string path, bool includeSubdirectories);
37+
IEnumerable<string> EnumerateFiles(string path, bool includeSubdirectories);
3938

4039
/// <summary>
4140
/// Read a static mapping file as text.
4241
/// </summary>
4342
/// <param name="path">The path (folder + filename with .json extension).</param>
4443
/// <returns>The file content as text.</returns>
45-
string ReadMappingFile([NotNull] string path);
44+
string ReadMappingFile(string path);
4645

4746
/// <summary>
4847
/// Write the static mapping file.
4948
/// </summary>
5049
/// <param name="path">The path (folder + filename with .json extension).</param>
5150
/// <param name="text">The text.</param>
52-
void WriteMappingFile([NotNull] string path, [NotNull] string text);
51+
void WriteMappingFile(string path, string text);
5352

5453
/// <summary>
5554
/// Read a response body file as byte[].
5655
/// </summary>
5756
/// <param name="path">The path or filename from the file to read.</param>
5857
/// <returns>The file content as bytes.</returns>
59-
byte[] ReadResponseBodyAsFile([NotNull] string path);
58+
byte[] ReadResponseBodyAsFile(string path);
6059

6160
/// <summary>
6261
/// Read a response body file as text.
6362
/// </summary>
6463
/// <param name="path">The path or filename from the file to read.</param>
6564
/// <returns>The file content as text.</returns>
66-
string ReadResponseBodyAsString([NotNull] string path);
65+
string ReadResponseBodyAsString(string path);
6766

6867
/// <summary>
6968
/// Delete a file.
7069
/// </summary>
7170
/// <param name="filename">The filename.</param>
72-
void DeleteFile([NotNull] string filename);
71+
void DeleteFile(string filename);
7372

7473
/// <summary>
7574
/// Determines whether the given path refers to an existing file on disk.
7675
/// </summary>
7776
/// <param name="filename">The filename.</param>
7877
/// <returns>true if path refers to an existing file; false if the file does not exist.</returns>
79-
bool FileExists([NotNull] string filename);
78+
bool FileExists(string filename);
8079

8180
/// <summary>
8281
/// Write a file.
8382
/// </summary>
8483
/// <param name="filename">The filename.</param>
8584
/// <param name="bytes">The bytes.</param>
86-
void WriteFile([NotNull] string filename, [NotNull] byte[] bytes);
85+
void WriteFile(string filename, byte[] bytes);
8786

8887
/// <summary>
8988
/// Write a file.
9089
/// </summary>
9190
/// <param name="folder">The folder.</param>
9291
/// <param name="filename">The filename.</param>
9392
/// <param name="bytes">The bytes.</param>
94-
void WriteFile([NotNull] string folder, [NotNull] string filename, [NotNull] byte[] bytes);
93+
void WriteFile(string folder, string filename, byte[] bytes);
9594

9695
/// <summary>
9796
/// Read a file as bytes.
9897
/// </summary>
9998
/// <param name="filename">The filename.</param>
10099
/// <returns>The file content as bytes.</returns>
101-
byte[] ReadFile([NotNull] string filename);
100+
byte[] ReadFile(string filename);
102101

103102
/// <summary>
104103
/// Read a file as string.
105104
/// </summary>
106105
/// <param name="filename">The filename.</param>
107106
/// <returns>The file content as a string.</returns>
108-
string ReadFileAsString([NotNull] string filename);
107+
string ReadFileAsString(string filename);
109108

110109
/// <summary>
111110
/// Gets the folder where the unmatched requests should be stored. For local file system, this would be `{CurrentFolder}/requests/unmatched`.
@@ -114,9 +113,9 @@ public interface IFileSystemHandler
114113
string GetUnmatchedRequestsFolder();
115114

116115
/// <summary>
117-
/// Write a unmatched request to the Unmatched RequestsFolder.
116+
/// Write an unmatched request to the Unmatched RequestsFolder.
118117
/// </summary>
119118
/// <param name="filename">The filename.</param>
120119
/// <param name="text">The text.</param>
121-
void WriteUnmatchedRequest([NotNull] string filename, [NotNull] string text);
120+
void WriteUnmatchedRequest(string filename, string text);
122121
}

src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.AtUrl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright © WireMock.Net
22

3-
#pragma warning disable CS1591
43
using WireMock.Extensions;
54
using WireMock.Matchers;
65

76
// ReSharper disable once CheckNamespace
87
namespace WireMock.FluentAssertions;
98

9+
#pragma warning disable CS1591
1010
public partial class WireMockAssertions
1111
{
1212
[CustomAssertion]

src/WireMock.Net/Json/JObjectExtensions.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright © WireMock.Net
22

3-
// Copied from https://github.com/Handlebars-Net/Handlebars.Net.Helpers/blob/master/src/Handlebars.Net.Helpers.DynamicLinq
3+
// Copied from https://github.com/Handlebars-Net/Handlebars.Net.Helpers/blob/master/src/Handlebars.Net.Helpers.DynamicLinq which is copied from https://github.com/StefH/JsonConverter
44

55
using System;
66
using System.Collections;
@@ -14,9 +14,7 @@ namespace WireMock.Json;
1414

1515
internal static class JObjectExtensions
1616
{
17-
private class JTokenResolvers : Dictionary<JTokenType, Func<JToken, DynamicJsonClassOptions?, object?>>
18-
{
19-
}
17+
private class JTokenResolvers : Dictionary<JTokenType, Func<JToken, DynamicJsonClassOptions?, object?>>;
2018

2119
private static readonly JTokenResolvers Resolvers = new()
2220
{
@@ -180,7 +178,7 @@ private static IEnumerable ConvertJTokenArray(JToken arg, DynamicJsonClassOption
180178
private static IEnumerable ConvertToTypedArray(IEnumerable<object?> src, Type newType)
181179
{
182180
var method = ConvertToTypedArrayGenericMethod.MakeGenericMethod(newType);
183-
return (IEnumerable)method.Invoke(null, new object[] { src })!;
181+
return (IEnumerable)method.Invoke(null, [src])!;
184182
}
185183

186184
private static readonly MethodInfo ConvertToTypedArrayGenericMethod = typeof(JObjectExtensions).GetMethod(nameof(ConvertToTypedArrayGeneric), BindingFlags.NonPublic | BindingFlags.Static)!;
@@ -193,7 +191,7 @@ private static T[] ConvertToTypedArrayGeneric<T>(IEnumerable<object> src)
193191
public static DynamicClass CreateInstance(IList<DynamicPropertyWithValue> dynamicPropertiesWithValue, bool createParameterCtor = true)
194192
{
195193
var type = DynamicClassFactory.CreateType(dynamicPropertiesWithValue.Cast<DynamicProperty>().ToArray(), createParameterCtor);
196-
var dynamicClass = (DynamicClass)Activator.CreateInstance(type);
194+
var dynamicClass = (DynamicClass)Activator.CreateInstance(type)!;
197195
foreach (var dynamicPropertyWithValue in dynamicPropertiesWithValue.Where(p => p.Value != null))
198196
{
199197
dynamicClass.SetDynamicPropertyValue(dynamicPropertyWithValue.Name, dynamicPropertyWithValue.Value!);

src/WireMock.Net/Owin/Mappers/OwinResponseMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private bool IsFault(IResponseMessage responseMessage)
152152
#if PROTOBUF
153153
case BodyType.ProtoBuf:
154154
var protoDefinitions = bodyData.ProtoDefinition?.Invoke().Texts;
155-
return await ProtoBufUtils.GetProtoBufMessageWithHeaderAsync(protoDefinitions, responseMessage.BodyData.ProtoBufMessageType, responseMessage.BodyData.BodyAsJson).ConfigureAwait(false);
155+
return await ProtoBufUtils.GetProtoBufMessageWithHeaderAsync(protoDefinitions, bodyData.ProtoBufMessageType, bodyData.BodyAsJson).ConfigureAwait(false);
156156
#endif
157157

158158
case BodyType.Bytes:

src/WireMock.Net/RequestBuilders/Request.WithBodyAsProtoBuf.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright © WireMock.Net
22

33
using System.Collections.Generic;
4-
using System.Linq;
54
using WireMock.Matchers;
65
using WireMock.Matchers.Request;
76
using WireMock.Models;

0 commit comments

Comments
 (0)