Webhook: Use the transformed URL to create the HttpRequestMessage (#843)

Co-authored-by: Gerhard Gradnig <gerhard.gradnig@admiral.at>
This commit is contained in:
Gerhard Gradnig
2022-11-05 10:54:39 +01:00
committed by GitHub
parent 80931e9fb5
commit 49b29d74dc
2 changed files with 3 additions and 2 deletions

View File

@@ -89,7 +89,7 @@ internal class WebhookSender
}; };
// Create HttpRequestMessage // Create HttpRequestMessage
var httpRequestMessage = HttpRequestMessageHelper.Create(requestMessage, webhookRequest.Url); var httpRequestMessage = HttpRequestMessageHelper.Create(requestMessage, webhookRequestUrl);
// Delay (if required) // Delay (if required)
if (TryGetDelay(webhookRequest, out var delay)) if (TryGetDelay(webhookRequest, out var delay))

View File

@@ -89,7 +89,7 @@ public class WireMockServerWebhookTests
{ {
// Assign // Assign
var serverReceivingTheWebhook = WireMockServer.Start(); var serverReceivingTheWebhook = WireMockServer.Start();
serverReceivingTheWebhook.Given(Request.Create().WithPath("x").UsingPost()).RespondWith(Response.Create().WithStatusCode(200)); serverReceivingTheWebhook.Given(Request.Create().WithPath("/x").UsingPost()).RespondWith(Response.Create().WithStatusCode(200));
// Act // Act
var server = WireMockServer.Start(); var server = WireMockServer.Start();
@@ -126,6 +126,7 @@ public class WireMockServerWebhookTests
content.Should().Be("a-response"); content.Should().Be("a-response");
serverReceivingTheWebhook.LogEntries.Should().HaveCount(1); serverReceivingTheWebhook.LogEntries.Should().HaveCount(1);
serverReceivingTheWebhook.LogEntries.First().MappingGuid.Should().NotBeNull();
server.Dispose(); server.Dispose();
serverReceivingTheWebhook.Dispose(); serverReceivingTheWebhook.Dispose();