Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RabbitMQContainer ¶
type RabbitMQContainer struct {
testcontainers.Container
URI string
Host string
Port string
Username string
Password string
}
RabbitMQContainer wraps a testcontainers RabbitMQ instance. It provides helper methods to get connection details for integration tests.
func SetupRabbitMQContainer ¶
func SetupRabbitMQContainer(t *testing.T) *RabbitMQContainer
SetupRabbitMQContainer starts a RabbitMQ container for integration testing.
The container is configured with:
- RabbitMQ 3.13 with management plugin
- Default credentials: guest/guest
- Ports: 5672 (AMQP), 15672 (Management UI)
- 2-minute startup timeout
Usage:
func TestIntegration(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
container := SetupRabbitMQContainer(t)
defer container.Teardown(t)
// Use container.URI for connection
}
func (*RabbitMQContainer) ManagementURL ¶
func (c *RabbitMQContainer) ManagementURL() string
ManagementURL returns the URL for the RabbitMQ management UI.
This can be used to verify queue state or debug test failures.
func (*RabbitMQContainer) Teardown ¶
func (c *RabbitMQContainer) Teardown(t *testing.T)
Teardown terminates the RabbitMQ container and cleans up resources.
This should be called with defer immediately after SetupRabbitMQContainer:
container := SetupRabbitMQContainer(t) defer container.Teardown(t)
Click to show internal directories.
Click to hide internal directories.