diff --git a/src/Http/Wolverine.Http.Tests/Bugs/Bug_970_starting_up_in_mediator_only_mode.cs b/src/Http/Wolverine.Http.Tests/Bugs/Bug_970_starting_up_in_mediator_only_mode.cs index 709c09903..ce43a9c73 100644 --- a/src/Http/Wolverine.Http.Tests/Bugs/Bug_970_starting_up_in_mediator_only_mode.cs +++ b/src/Http/Wolverine.Http.Tests/Bugs/Bug_970_starting_up_in_mediator_only_mode.cs @@ -37,6 +37,8 @@ public async Task can_call_through() }); builder.Services.AddControllers(); + + builder.Services.AddWolverineHttp(); // This is using Alba, which uses WebApplicationFactory under the covers await using var host = await AlbaHost.For(builder, app => diff --git a/src/Http/Wolverine.Http.Tests/dead_letter_endpoints.cs b/src/Http/Wolverine.Http.Tests/dead_letter_endpoints.cs index 10f788aa7..f8bf9e72f 100644 --- a/src/Http/Wolverine.Http.Tests/dead_letter_endpoints.cs +++ b/src/Http/Wolverine.Http.Tests/dead_letter_endpoints.cs @@ -1,5 +1,6 @@ using JasperFx.Core.Reflection; using Shouldly; +using Wolverine.Tracking; using WolverineWebApi; namespace Wolverine.Http.Tests; @@ -11,10 +12,14 @@ public async Task fetch_them() { // Given var exceptionMessage = $"fetchable-{Guid.NewGuid()}"; - await Scenario(x => + + await Host.TrackActivity().DoNotAssertOnExceptionsDetected().ExecuteAndWaitAsync(_ => { - x.Post.Json(new MessageThatAlwaysGoesToDeadLetter(exceptionMessage)).ToUrl("/send/always-dead-letter"); - x.StatusCodeShouldBe(202); + return Scenario(x => + { + x.Post.Json(new MessageThatAlwaysGoesToDeadLetter(exceptionMessage)).ToUrl("/send/always-dead-letter"); + x.StatusCodeShouldBe(202); + }); }); // When @@ -46,12 +51,16 @@ public async Task replay_one() { // Given var exceptionMessage = $"replayable-{Guid.NewGuid()}"; - await Scenario(x => + + await Host.TrackActivity().DoNotAssertOnExceptionsDetected().ExecuteAndWaitAsync(_ => { - x.Post.Json(new MessageThatAlwaysGoesToDeadLetter(exceptionMessage)).ToUrl("/send/always-dead-letter"); - x.StatusCodeShouldBe(202); + return Scenario(x => + { + x.Post.Json(new MessageThatAlwaysGoesToDeadLetter(exceptionMessage)).ToUrl("/send/always-dead-letter"); + x.StatusCodeShouldBe(202); + }); }); - + var result = await Scenario(x => { x.Post.Json(new DeadLetterEnvelopeGetRequest @@ -76,12 +85,16 @@ public async Task delete_one() { // Given var exceptionMessage = $"deletable-{Guid.NewGuid()}"; - await Scenario(x => + + await Host.TrackActivity().DoNotAssertOnExceptionsDetected().ExecuteAndWaitAsync(_ => { - x.Post.Json(new MessageThatAlwaysGoesToDeadLetter(exceptionMessage)).ToUrl("/send/always-dead-letter"); - x.StatusCodeShouldBe(202); + return Scenario(x => + { + x.Post.Json(new MessageThatAlwaysGoesToDeadLetter(exceptionMessage)).ToUrl("/send/always-dead-letter"); + x.StatusCodeShouldBe(202); + }); }); - + var result = await Scenario(x => { x.Post.Json(new DeadLetterEnvelopeGetRequest @@ -92,6 +105,7 @@ await Scenario(x => // When & Expect var deadletters = result.ReadAsJson(); + await Scenario(x => { x.Delete.Json(new DeadLetterEnvelopeIdsRequest