Skip to content

Replace Audit interception helper with spy endpoints - #5915

Closed
afprtclr with Copilot wants to merge 3 commits into
masterfrom
copilot/implement-issue-4176
Closed

afprtclr with Copilot wants to merge 3 commits into
masterfrom
copilot/implement-issue-4176

Conversation

Copilot AI commented Sep 22, 2026 •

Copy link
Copy Markdown

The Audit acceptance tests were verifying messages to the primary ServiceControl instance by intercepting outgoing pipeline operations instead of observing delivery at the destination. This updates those tests to use the repository’s established spy-endpoint pattern and removes the now-obsolete interception support.

  • What changed

    • Refactored the affected Audit acceptance tests to point ServiceControlQueueAddress at a per-test spy endpoint.
    • Replaced pipeline interception with real RegisterNewEndpoint handlers that record what actually arrives at the primary destination queue.
    • Preserved the existing assertions while tightening the verification point to delivered messages.
  • Tests updated

    • Monitoring/When_a_new_endpoint_is_detected
    • Recoverability/When_importing_a_message_resolved_by_a_retry
  • Test support cleanup

    • Removed InterceptMessagesDestinedToServiceControl
    • Removed InterceptedMessagesScenarioContext
  • Spy endpoint pattern

    • Each test now spins up a dedicated endpoint at the configured primary ServiceControl address and captures RegisterNewEndpoint in scenario context.
    • The spy endpoint is configured to tolerate the audit instance’s startup probe traffic, matching existing repository conventions for queue spies.
SetSettings = settings =>
    settings.ServiceControlQueueAddress = Conventions.EndpointNamingConvention(typeof(ServiceControlSpy));

var context = await Define<Context>()
    .WithEndpoint<ServiceControlSpy>(b => b.DoNotFailOnErrorMessages())
    .WithEndpoint<Receiver>(b => b.When((bus, _) => bus.SendLocal(new MyMessage())))
    .Done(c => c.SentRegisterEndpointCommands.Any())
    .Run();

Copilot AI and others added 2 commits September 22, 2026 14:50
Co-authored-by: afprtclr <208591451+afprtclr@users.noreply.github.com>
Co-authored-by: afprtclr <208591451+afprtclr@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor interception helper to use SpyEndpoints pattern Replace Audit interception helper with spy endpoints Sep 22, 2026
Copilot AI requested a review from afprtclr September 22, 2026 14:57
@afprtclr afprtclr closed this Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants