test(notifications): guard scheduled job casts
Heimdall Gitea / Build and tests (pull_request) Failing after 2m15s
Heimdall Gitea / Build and scan server image (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Failing after 1s
Heimdall Gitea / Detect CI scope (pull_request) Successful in 5s

This commit is contained in:
Arnaud Dartois committed 2026-10-25 21:13:10 +01:00
1 parent fb74c58a88
commit 1371eefb70
1 file changed
+2 -2
@@ -132,14 +132,14 @@ public sealed class NotificationDeliveryOutboxTests(PostgreSqlContainerFixture p
var scheduled = backgroundJobs.ReceivedCalls()
.Where(call => call.GetMethodInfo().Name == nameof(IBackgroundJobClient.Create))
.Select(call => call.GetArguments())
.Select(args => (Job)args[0])
.Select(args => (Job)args[0]!)
.ToArray();
scheduled.Length.ShouldBe(3);
scheduled.Select(job => (Guid)job.Args[0]!).ShouldBe([dueEmailId, dueNtfyId, expiredLeaseId]);
var queues = backgroundJobs.ReceivedCalls()
.Where(call => call.GetMethodInfo().Name == nameof(IBackgroundJobClient.Create))
.Select(call => (EnqueuedState)call.GetArguments()[1])
.Select(call => (EnqueuedState)call.GetArguments()[1]!)
.Select(state => state.Queue)
.ToArray();
queues.ShouldBe(["email", "ntfy", "email"]);