Upgraded RabbitMQ from version 3-management to 4-management across tests and the Docker setup. This ensures compatibility with the latest features and improvements in RabbitMQ while maintaining consistency across environments.
32 lines
849 B
C#
32 lines
849 B
C#
using Testcontainers.PostgreSql;
|
|
using Testcontainers.RabbitMq;
|
|
|
|
namespace Elsa.AzureServiceBus.ComponentTests;
|
|
|
|
public class Infrastructure : IAsyncLifetime
|
|
{
|
|
public readonly PostgreSqlContainer DbContainer = new PostgreSqlBuilder()
|
|
.WithImage("postgres:latest")
|
|
.WithDatabase("elsa")
|
|
.WithUsername("postgres")
|
|
.WithPassword("postgres")
|
|
.Build();
|
|
|
|
public readonly RabbitMqContainer RabbitMqContainer = new RabbitMqBuilder()
|
|
.WithImage("rabbitmq:4-management")
|
|
.Build();
|
|
|
|
public Task InitializeAsync()
|
|
{
|
|
return Task.WhenAll(
|
|
DbContainer.StartAsync(),
|
|
RabbitMqContainer.StartAsync());
|
|
}
|
|
|
|
public Task DisposeAsync()
|
|
{
|
|
return Task.WhenAll(
|
|
DbContainer.StopAsync(),
|
|
RabbitMqContainer.StopAsync());
|
|
}
|
|
} |