ktestify-plugin-azureblob is a ktestify plugin that adds Azure Blob Storage transport support. It implements the KtestifyPlugin SPI from ktestify-core and ships ready-to-use Cucumber step definitions for uploading and asserting blobs inside your Kafka integration test scenarios.
Drop the JAR into your ktestify-cucumber setup and the steps are automatically discovered — no code changes required.
<dependency>
<groupId>io.github.ktestify</groupId>
<artifactId>ktestify-plugin-azureblob</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>Drop the plugin JAR into the /workspace/plugins mount and ktestify-cucumber will load it automatically via ServiceLoader at startup:
docker run --rm \
-v $(pwd)/features:/workspace/features \
-v $(pwd)/assets:/workspace/assets \
-v $(pwd)/plugins:/workspace/plugins \ # ← drop ktestify-plugin-azureblob-*.jar here
-e AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=..." \
ghcr.io/ktestify/ktestify-cucumber:latest \
/workspace/features# Upload a blob before the Kafka action
Given blob container
| containerName | containerAlias |
| my-container | blobs |
When blob from file is uploaded
| containerAlias | file | blobName |
| blobs | payload.json | orders/input.json|
# Assert a blob was written by the system under test
Then expected blob from file
| containerAlias | blobName | file |
| blobs | orders/output.json | expected-order.json |
And blob should not exist
| containerAlias | blobName |
| blobs | orders/error.json|Feature: Order pipeline writes result blob
Background:
Given namespace
| namespace |
| my-org |
Given input topic
| topicName | topicAlias |
| orders | orders-in |
Given blob container
| containerName | containerAlias |
| results | results-blob |
Given assets directory
| absolutePath |
| src/test/resources/data/orders |
Scenario: Processed order is stored in Azure Blob
When record from file is sent
| topicName | file | recordKey |
| orders | order.json | ORD-001 |
And wait for 5 seconds
Then expected blob from file
| containerAlias | blobName | file |
| results-blob | ORD-001/result.json | expected-result.json |The plugin reads its settings from the ktestify.plugins.azure-blob HOCON block. All values can be overridden via environment variables.
ktestify.plugins.azure-blob {
# Storage account connection string (takes precedence over SAS / account-key)
connection-string = ""
connection-string = ${?AZURE_STORAGE_CONNECTION_STRING}
# SAS token — used when connection-string is not set
sas-token = ""
sas-token = ${?AZURE_STORAGE_SAS_TOKEN}
# Storage account endpoint (required when using SAS or managed identity)
endpoint = ""
endpoint = ${?AZURE_STORAGE_ENDPOINT}
# Default request timeout for blob operations
request-timeout = 30s
# Create containers automatically if they do not exist
auto-create-containers = true
}Use the Azurite emulator for local and CI testing — no real Azure account needed:
docker run -p 10000:10000 mcr.microsoft.com/azure-storage/azurite azurite-blob --loosektestify.plugins.azure-blob {
connection-string = "UseDevelopmentStorage=true"
}This plugin implements the KtestifyPlugin SPI:
public class AzureBlobPlugin implements KtestifyPlugin {
@Override public String getId() { return "azure-blob"; }
@Override public String getGluePackage() { return "io.github.ktestify.plugin.azureblob.steps"; }
@Override
public void initialize(PluginContext ctx) {
// reads ktestify.plugins.azure-blob from ctx.getConfig()
}
}It is discovered automatically by ServiceLoader — the META-INF/services/io.github.ktestify.plugin.KtestifyPlugin descriptor is included in the JAR.
- ktestify-core — the foundation library and plugin SPI
- ktestify-cucumber — the BDD runner this plugin extends
- docs.ktestify.xyz — full documentation and configuration reference
Contributions are welcome. Please read the contributing guide before opening a pull request.
- Fork the repository
- Create a feature branch —
git checkout -b feat/my-feature - Commit with Conventional Commits —
git commit -m "feat: add my feature" - Push and open a Pull Request against
main
ktestify-plugin-azureblob is licensed under the Apache License 2.0.
