Skip to content

Commit

Permalink
Webhook: Use the transformed URL to create the HttpRequestMessage (#843)
Browse files Browse the repository at this point in the history
Co-authored-by: Gerhard Gradnig <gerhard.gradnig@admiral.at>
  • Loading branch information
ggradnig and Gerhard Gradnig committed Nov 5, 2022
1 parent 80931e9 commit 49b29d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/WireMock.Net/Http/WebhookSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ IResponseMessage originalResponseMessage
};

// Create HttpRequestMessage
var httpRequestMessage = HttpRequestMessageHelper.Create(requestMessage, webhookRequest.Url);
var httpRequestMessage = HttpRequestMessageHelper.Create(requestMessage, webhookRequestUrl);

// Delay (if required)
if (TryGetDelay(webhookRequest, out var delay))
Expand Down
3 changes: 2 additions & 1 deletion test/WireMock.Net.Tests/WireMockServer.WebhookTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public async Task WireMockServer_WithWebhook_Should_Send_Message_To_Webhook()
{
// Assign
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
var server = WireMockServer.Start();
Expand Down Expand Up @@ -126,6 +126,7 @@ public async Task WireMockServer_WithWebhook_Should_Send_Message_To_Webhook()
content.Should().Be("a-response");

serverReceivingTheWebhook.LogEntries.Should().HaveCount(1);
serverReceivingTheWebhook.LogEntries.First().MappingGuid.Should().NotBeNull();

server.Dispose();
serverReceivingTheWebhook.Dispose();
Expand Down

0 comments on commit 49b29d7

Please sign in to comment.