!!! note This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See our contributing guidelines for more information on our incubating modules policy.
Testcontainers module for the Microsoft Azure's SDK.
Currently, the module supports CosmosDB emulator. In order to use it, you should use the following class:
| Class | Container Image |
|---|---|
| CosmosDBEmulatorContainer | mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator |
Start Azure CosmosDB Emulator during a test:
Starting a Azure CosmosDB Emulator container inside_block:emulatorContainer
Prepare KeyStore to use for SSL.
Building KeyStore from certificate within container inside_block:buildAndSaveNewKeyStore
Set system trust-store parameters to use already built KeyStore:
Set system trust-store parameters inside_block:setSystemTrustStoreParameters
Build Azure CosmosDB client:
Build Azure CosmosDB client inside_block:buildClient
Test against the Emulator:
Testing against Azure CosmosDB Emulator container inside_block:testWithClientAgainstEmulatorContainer
Add the following dependency to your pom.xml/build.gradle file:
=== "Gradle"
groovy testImplementation "org.testcontainers:azure:{{latest_version}}"
=== "Maven"
xml <dependency> <groupId>org.testcontainers</groupId> <artifactId>azure</artifactId> <version>{{latest_version}}</version> <scope>test</scope> </dependency>