mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-05-10 01:44:08 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15ece7ec09 | ||
|
|
336cb7ccae |
@@ -1,8 +1,3 @@
|
|||||||
# 1.5.56 (03 June 2024)
|
|
||||||
- [#1111](https://github.com/WireMock-Net/WireMock.Net/pull/1111) - Fix Request.Create().WithBodyAsJson(...) [bug] contributed by [StefH](https://github.com/StefH)
|
|
||||||
- [#1112](https://github.com/WireMock-Net/WireMock.Net/pull/1112) - Add "/__admin/health" endpoint [feature] contributed by [StefH](https://github.com/StefH)
|
|
||||||
- [#1110](https://github.com/WireMock-Net/WireMock.Net/issues/1110) - Connection prematurely closed BEFORE response [bug]
|
|
||||||
|
|
||||||
# 1.5.55 (22 May 2024)
|
# 1.5.55 (22 May 2024)
|
||||||
- [#1107](https://github.com/WireMock-Net/WireMock.Net/pull/1107) - When only Port is provided, bind to * (Fixes #1100) [bug] contributed by [StefH](https://github.com/StefH)
|
- [#1107](https://github.com/WireMock-Net/WireMock.Net/pull/1107) - When only Port is provided, bind to * (Fixes #1100) [bug] contributed by [StefH](https://github.com/StefH)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VersionPrefix>1.5.56</VersionPrefix>
|
<VersionPrefix>1.5.55</VersionPrefix>
|
||||||
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
|
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
|
||||||
<PackageProjectUrl>https://github.com/WireMock-Net/WireMock.Net</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/WireMock-Net/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=1.5.56
|
SET version=1.5.55
|
||||||
|
|
||||||
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels question invalid doc duplicate example --version %version% --token %GH_TOKEN%
|
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels question invalid doc duplicate example --version %version% --token %GH_TOKEN%
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
# 1.5.56 (03 June 2024)
|
# 1.5.55 (22 May 2024)
|
||||||
- #1111 Fix Request.Create().WithBodyAsJson(...) [bug]
|
- #1107 When only Port is provided, bind to * (Fixes #1100) [bug]
|
||||||
- #1112 Add "/__admin/health" endpoint [feature]
|
|
||||||
- #1110 Connection prematurely closed BEFORE response [bug]
|
|
||||||
|
|
||||||
The full release notes can be found here: https://github.com/WireMock-Net/WireMock.Net/blob/master/CHANGELOG.md
|
The full release notes can be found here: https://github.com/WireMock-Net/WireMock.Net/blob/master/CHANGELOG.md
|
||||||
@@ -229,6 +229,7 @@ message HelloReply {
|
|||||||
server.SetBasicAuthentication("a", "b");
|
server.SetBasicAuthentication("a", "b");
|
||||||
//server.SetAzureADAuthentication("6c2a4722-f3b9-4970-b8fc-fac41e29stef", "8587fde1-7824-42c7-8592-faf92b04stef");
|
//server.SetAzureADAuthentication("6c2a4722-f3b9-4970-b8fc-fac41e29stef", "8587fde1-7824-42c7-8592-faf92b04stef");
|
||||||
|
|
||||||
|
|
||||||
//var http = new HttpClient();
|
//var http = new HttpClient();
|
||||||
//var response = await http.GetAsync($"{_wireMockServer.Url}/pricing");
|
//var response = await http.GetAsync($"{_wireMockServer.Url}/pricing");
|
||||||
//var value = await response.Content.ReadAsStringAsync();
|
//var value = await response.Content.ReadAsStringAsync();
|
||||||
|
|||||||
@@ -24,24 +24,12 @@ public interface IWireMockAdminApi
|
|||||||
[Header("Authorization")]
|
[Header("Authorization")]
|
||||||
AuthenticationHeaderValue Authorization { get; set; }
|
AuthenticationHeaderValue Authorization { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get health status.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="cancellationToken">The optional cancellationToken.</param>
|
|
||||||
/// <returns>
|
|
||||||
/// Returns HttpStatusCode <c>200</c> with a value <c>Healthy</c> to indicate that WireMock.Net is healthy.
|
|
||||||
/// Else it returns HttpStatusCode <c>404</c>.
|
|
||||||
/// </returns>
|
|
||||||
[Get("health")]
|
|
||||||
[AllowAnyStatusCode]
|
|
||||||
Task<string> GetHealthAsync(CancellationToken cancellationToken = default);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the settings.
|
/// Get the settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>SettingsModel</returns>
|
/// <returns>SettingsModel</returns>
|
||||||
[Get("settings")]
|
[Get("settings")]
|
||||||
Task<SettingsModel> GetSettingsAsync(CancellationToken cancellationToken = default);
|
Task<SettingsModel> GetSettingsAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update the settings.
|
/// Update the settings.
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public partial class WireMockServer
|
|||||||
{
|
{
|
||||||
private const int EnhancedFileSystemWatcherTimeoutMs = 1000;
|
private const int EnhancedFileSystemWatcherTimeoutMs = 1000;
|
||||||
private const string AdminFiles = "/__admin/files";
|
private const string AdminFiles = "/__admin/files";
|
||||||
private const string AdminHealth = "/__admin/health";
|
|
||||||
private const string AdminMappings = "/__admin/mappings";
|
private const string AdminMappings = "/__admin/mappings";
|
||||||
private const string AdminMappingsCode = "/__admin/mappings/code";
|
private const string AdminMappingsCode = "/__admin/mappings/code";
|
||||||
private const string AdminMappingsWireMockOrg = "/__admin/mappings/wiremock.org";
|
private const string AdminMappingsWireMockOrg = "/__admin/mappings/wiremock.org";
|
||||||
@@ -55,9 +54,6 @@ public partial class WireMockServer
|
|||||||
#region InitAdmin
|
#region InitAdmin
|
||||||
private void InitAdmin()
|
private void InitAdmin()
|
||||||
{
|
{
|
||||||
// __admin/health
|
|
||||||
Given(Request.Create().WithPath(AdminHealth).UsingGet()).AtPriority(WireMockConstants.AdminPriority).RespondWith(new DynamicResponseProvider(HealthGet));
|
|
||||||
|
|
||||||
// __admin/settings
|
// __admin/settings
|
||||||
Given(Request.Create().WithPath(AdminSettings).UsingGet()).AtPriority(WireMockConstants.AdminPriority).RespondWith(new DynamicResponseProvider(SettingsGet));
|
Given(Request.Create().WithPath(AdminSettings).UsingGet()).AtPriority(WireMockConstants.AdminPriority).RespondWith(new DynamicResponseProvider(SettingsGet));
|
||||||
Given(Request.Create().WithPath(AdminSettings).UsingMethod("PUT", "POST").WithHeader(HttpKnownHeaderNames.ContentType, AdminRequestContentTypeJson)).AtPriority(WireMockConstants.AdminPriority).RespondWith(new DynamicResponseProvider(SettingsUpdate));
|
Given(Request.Create().WithPath(AdminSettings).UsingMethod("PUT", "POST").WithHeader(HttpKnownHeaderNames.ContentType, AdminRequestContentTypeJson)).AtPriority(WireMockConstants.AdminPriority).RespondWith(new DynamicResponseProvider(SettingsUpdate));
|
||||||
@@ -222,22 +218,6 @@ public partial class WireMockServer
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Health
|
|
||||||
private static IResponseMessage HealthGet(IRequestMessage requestMessage)
|
|
||||||
{
|
|
||||||
return new ResponseMessage
|
|
||||||
{
|
|
||||||
BodyData = new BodyData
|
|
||||||
{
|
|
||||||
DetectedBodyType = BodyType.String,
|
|
||||||
BodyAsString = "Healthy"
|
|
||||||
},
|
|
||||||
StatusCode = (int)HttpStatusCode.OK,
|
|
||||||
Headers = new Dictionary<string, WireMockList<string>> { { HttpKnownHeaderNames.ContentType, new WireMockList<string>(WireMockConstants.ContentTypeTextPlain) } }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Settings
|
#region Settings
|
||||||
private IResponseMessage SettingsGet(IRequestMessage requestMessage)
|
private IResponseMessage SettingsGet(IRequestMessage requestMessage)
|
||||||
{
|
{
|
||||||
@@ -850,4 +830,4 @@ public partial class WireMockServer
|
|||||||
var singleResult = ((JObject)value).ToObject<T>();
|
var singleResult = ((JObject)value).ToObject<T>();
|
||||||
return new[] { singleResult! };
|
return new[] { singleResult! };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,18 +41,6 @@ public partial class WireMockAdminApiTests
|
|||||||
VerifyNewtonsoftJson.Enable(VerifySettings);
|
VerifyNewtonsoftJson.Enable(VerifySettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public async Task IWireMockAdminApi_GetHealthAsync()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
var server = WireMockServer.StartWithAdminInterface();
|
|
||||||
var api = RestClient.For<IWireMockAdminApi>(server.Urls[0]);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var status = await api.GetHealthAsync().ConfigureAwait(false);
|
|
||||||
status.Should().Be("Healthy");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task IWireMockAdminApi_GetSettingsAsync()
|
public async Task IWireMockAdminApi_GetSettingsAsync()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class WireMockServerProxyTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
server.Mappings.Should().HaveCount(36);
|
server.Mappings.Should().HaveCount(35);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class WireMockServerSettingsTests
|
|||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
server.Mappings.Should().NotBeNull();
|
server.Mappings.Should().NotBeNull();
|
||||||
server.Mappings.Should().HaveCount(34);
|
server.Mappings.Should().HaveCount(33);
|
||||||
server.Mappings.All(m => m.Priority == WireMockConstants.AdminPriority).Should().BeTrue();
|
server.Mappings.All(m => m.Priority == WireMockConstants.AdminPriority).Should().BeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,9 +100,9 @@ public class WireMockServerSettingsTests
|
|||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
server.Mappings.Should().NotBeNull();
|
server.Mappings.Should().NotBeNull();
|
||||||
server.Mappings.Should().HaveCount(35);
|
server.Mappings.Should().HaveCount(34);
|
||||||
|
|
||||||
server.Mappings.Count(m => m.Priority == WireMockConstants.AdminPriority).Should().Be(34);
|
server.Mappings.Count(m => m.Priority == WireMockConstants.AdminPriority).Should().Be(33);
|
||||||
server.Mappings.Count(m => m.Priority == WireMockConstants.ProxyPriority).Should().Be(1);
|
server.Mappings.Count(m => m.Priority == WireMockConstants.ProxyPriority).Should().Be(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user