mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
1.7.x (#1268)
* Fix construction of path in OpenApiParser (#1265) * Server-Sent Events (#1269) * Server Side Events * fixes * await HandleSseStringAsync(responseMessage, response, bodyData); * 1.7.5-preview-01 * IBlockingQueue * 1.7.5-preview-02 (03 April 2025) * IBlockingQueue * ... * Support OpenApi V31 (#1279) * Support OpenApi V31 * Update src/WireMock.Net.OpenApiParser/Extensions/OpenApiSchemaExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fx --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add ProtoDefinitionHelper.FromDirectory (#1263) * Add ProtoDefinitionHelper.FromDirectory * . * unix-windows * move test * imports in the proto files indeed should use a forward slash * updates * . * private Func<IdOrTexts> ProtoDefinitionFunc() * OpenTelemetry * . * fix path utils --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -97,6 +97,46 @@ message HelloReply {
|
||||
fullName:String
|
||||
}";
|
||||
|
||||
private static void RunSse()
|
||||
{
|
||||
var server = WireMockServer.Start(new WireMockServerSettings
|
||||
{
|
||||
Port = 9091,
|
||||
StartAdminInterface = true,
|
||||
Logger = new WireMockConsoleLogger()
|
||||
});
|
||||
server
|
||||
.WhenRequest(r => r
|
||||
.UsingGet()
|
||||
.WithPath("/sse")
|
||||
)
|
||||
.ThenRespondWith(r => r
|
||||
.WithHeader("Content-Type", "text/event-stream")
|
||||
.WithHeader("Cache-Control", "no-cache")
|
||||
.WithHeader("Connection", "keep-alive")
|
||||
.WithSseBody(async (_, q) =>
|
||||
{
|
||||
for (var i = 0; i < 5; i++)
|
||||
{
|
||||
q.Write("test " + i + "\r\n");
|
||||
await Task.Delay(5000);
|
||||
}
|
||||
|
||||
q.Close();
|
||||
})
|
||||
);
|
||||
|
||||
server
|
||||
.WhenRequest(r => r
|
||||
.UsingGet()
|
||||
)
|
||||
.ThenRespondWith(r => r
|
||||
.WithBody("normal")
|
||||
);
|
||||
|
||||
System.Console.ReadKey();
|
||||
}
|
||||
|
||||
private static void RunOnLocal()
|
||||
{
|
||||
try
|
||||
@@ -136,6 +176,7 @@ message HelloReply {
|
||||
|
||||
public static void Run()
|
||||
{
|
||||
RunSse();
|
||||
RunOnLocal();
|
||||
|
||||
var mappingBuilder = new MappingBuilder();
|
||||
|
||||
Reference in New Issue
Block a user