public static async Task SetupRabbitMqAsync() { if (RabbitTestContainer != null) { throw new InvalidOperationException("already initialized"); } var config = new SetupConfiguration { ContainerName = "rabbitmqpublisherintegrationtests", ImageName = "rabbitmq", ImageTag = "3-management", PortMappings = new List <PortConfiguration> { new PortConfiguration(15672), new PortConfiguration(5672) } }; RabbitTestContainer = await TestContainer.CreateAsync(config); }