This sample project shows how to use the Azure Service Bus emulator as a test container for local development and integration testing.
The Service Bus emulator, like the Event Hubs emulator, doesn’t have a dedicated Testcontainers module and relies on Azure SQL Edge.
You can initialize the Service Bus emulator as a test container in two ways:
1️⃣ Code Compose: Setting up containers programmatically with the GenericContainer class.
2️⃣ Docker Compose: Using a Docker Compose file for container orchestration.
For more details, visit the GitHub repository: https://github.com/mirkoiv/servicebus-emulator-as-testcontainer
Building Service Bus emulator as a Test Container
Service Bus emulator does not have a Testcontainers module (yet), and additionally the emulator requires Azure SQL Edge.
There are two ways to initialize the Service Bus Emulator as a test container:
1️⃣ code compose – Composing through code using the GenericContainer class – AbstractServiceBusContainerCodeCompose
2️⃣ docker compose – Using a Docker Compose file and ComposeContainer class – AbstractServiceBusContainerDockerCompose
Key Differences Between the Two Approaches
In the first case, tests or applications interact directly with the ports exposed by the generic emulator and storage test containers. In the second case, an additional ambassador container is created, serving as a proxy to the generic emulator and storage containers.
Code Compose:

Docker Compose:

For more details and run samples, visit the GitHub repository: https://github.com/mirkoiv/servicebus-emulator-as-testcontainer