diff --git a/src/NServiceBus.RabbitMQ.AcceptanceTests/App_Packages/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_using_a_broker_transport_with_centralized_routing.cs b/src/NServiceBus.RabbitMQ.AcceptanceTests/App_Packages/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_using_a_broker_transport_with_centralized_routing.cs index 192486017..c3232edaa 100644 --- a/src/NServiceBus.RabbitMQ.AcceptanceTests/App_Packages/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_using_a_broker_transport_with_centralized_routing.cs +++ b/src/NServiceBus.RabbitMQ.AcceptanceTests/App_Packages/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_using_a_broker_transport_with_centralized_routing.cs @@ -8,16 +8,22 @@ public class When_publishing_an_event_using_a_broker_transport_with_centralized_routing : NServiceBusAcceptanceTest { - [Test, Ignore("Not reliable!")] + [Test] public void Should_be_delivered_to_allsubscribers_without_the_need_for_config() { Scenario.Define() - .WithEndpoint(b => b.When(c => c.EndpointsStarted, (bus, context) => - { - bus.Publish(new MyEvent()); - })) - .WithEndpoint() - .WithEndpoint() + .WithEndpoint + (b => b.Given((bus, context) => Subscriptions.OnEndpointSubscribed(s => { })) + .When(c => c.IsSubscriptionProcessedForSub1 && c.IsSubscriptionProcessedForSub2, bus => bus.Publish(new MyEvent())) + ) + .WithEndpoint(b => b.Given((bus, context) => + { + context.IsSubscriptionProcessedForSub1 = true; + })) + .WithEndpoint(b => b.Given((bus, context) => + { + context.IsSubscriptionProcessedForSub2 = true; + })) .Done(c => c.Subscriber1GotTheEvent && c.Subscriber2GotTheEvent) .Repeat(r => r.For()) .Should(c => @@ -32,8 +38,10 @@ public void Should_be_delivered_to_allsubscribers_without_the_need_for_config() public class Context : ScenarioContext { public bool Subscriber1GotTheEvent { get; set; } - public bool Subscriber2GotTheEvent { get; set; } + + public bool IsSubscriptionProcessedForSub1 { get; set; } + public bool IsSubscriptionProcessedForSub2 { get; set; } } public class CentralizedPublisher : EndpointConfigurationBuilder