AAA
AAA

Reputation: 13

Azure Event Hub Integration test

I have written some code to push and pull data from Azure Event Hub. Searching through the internet couldn't find me any example of how to do the integration testing. In the past I was able to use testcontainers for pulsar and mqtt integration testing but couldn't find anything for Azure Event Hub. Test containers does have something called cosmodb which doesn't seem like the right thing. Would appreciate if anyone has any pointer.

Upvotes: 1

Views: 1668

Answers (1)

Bat0u89
Bat0u89

Reputation: 438

You can use event hubs emulator https://github.com/Azure/azure-event-hubs-emulator-installer, it requires azurite running as well (to emulate blob store). It's all in the readme. Sample code snippets are really helpful https://github.com/Azure/azure-event-hubs-emulator-installer/tree/main/Sample-Code-Snippets.

You'd have to use a recent enough dependency version though, in my case with java I had to use

<dependency>
  <groupId>com.azure</groupId>
  <artifactId>azure-messaging-eventhubs</artifactId>
  <version>5.18.6</version>
</dependency>

Upvotes: 0

Related Questions