XUnitAssured.Camunda.Testcontainers
6.43.0
dotnet add package XUnitAssured.Camunda.Testcontainers --version 6.43.0
NuGet\Install-Package XUnitAssured.Camunda.Testcontainers -Version 6.43.0
<PackageReference Include="XUnitAssured.Camunda.Testcontainers" Version="6.43.0" />
<PackageVersion Include="XUnitAssured.Camunda.Testcontainers" Version="6.43.0" />
<PackageReference Include="XUnitAssured.Camunda.Testcontainers" />
paket add XUnitAssured.Camunda.Testcontainers --version 6.43.0
#r "nuget: XUnitAssured.Camunda.Testcontainers, 6.43.0"
#:package XUnitAssured.Camunda.Testcontainers@6.43.0
#addin nuget:?package=XUnitAssured.Camunda.Testcontainers&version=6.43.0
#tool nuget:?package=XUnitAssured.Camunda.Testcontainers&version=6.43.0
XUnitAssured.Camunda.Testcontainers
Starts Camunda 8.10 inside dotnet test for
XUnitAssured.Camunda: a CI runner with
Docker needs no Camunda of its own.
Installation
dotnet add package XUnitAssured.Camunda.Testcontainers
Usage
using XUnitAssured.Camunda.Extensions;
using XUnitAssured.Camunda.Testcontainers;
using XUnitAssured.Camunda.Testing;
public class OrderTests(CamundaContainerFixture camunda)
: CamundaTestBase<CamundaContainerFixture>(camunda), IClassFixture<CamundaContainerFixture>
{
[Fact]
public async Task Order_Completes() =>
await Given()
.Deploy("order", "shipping")
.MockJobWorker("charge-card").ThenComplete()
.StartInstance("order")
.ExecuteAsync()
.AssertInstanceCompleted();
}
CamundaTestBase.Given() hands the container's address and credentials to the chain. Every verb
and assertion of XUnitAssured.Camunda works the same as against a remote cluster.
What it starts
- The same Camunda as the package's own CI:
camunda/camunda:8.10.4alone, with no Elasticsearch and no Connectors. Without Connectors, no runtime competes for the jobs you mock. - Secondary storage in H2, in memory, flushed at once (
FLUSHINTERVAL=PT0S), as the Camunda Process Test does: a search sees a change as soon as the engine makes it. - Only TLS, on REST and gRPC. On every run the fixture generates a test certificate authority and
a server certificate for
camunda,localhostand127.0.0.1, and the chains trust only that authority (Settings.CaCertificatePath). There is nohttpaddress. - Basic authentication with a
xunituser and a new random password on every run. The fixture hands both to the chains, so the test never needs them. Authorizations are off, as in the package's CI: the container is the test's own. - Ready means the REST API answered an authenticated https request, not that the process started. That takes about 35 seconds.
The timeouts (assertionTimeoutSeconds, pollIntervalMilliseconds, mockLifetimeSeconds) still
come from the camunda section of testsettings.json.
One Camunda for the whole suite
Starting Camunda for every test class would cost 35 seconds each. Share one container through a collection fixture:
[CollectionDefinition("Camunda")]
public sealed class CamundaCollection : ICollectionFixture<CamundaContainerFixture>;
[Collection("Camunda")]
public class OrderTests(CamundaContainerFixture camunda) : CamundaTestBase<CamundaContainerFixture>(camunda)
{
// ...
}
The package's isolation by process instance key still applies: tests sharing the container never see each other's jobs.
Customizing
Derive from the fixture to change the image, or to add settings to the container:
public sealed class MyCamunda : CamundaContainerFixture
{
protected override string Image => "camunda/camunda:8.10.5";
protected override ContainerBuilder Configure(ContainerBuilder builder) =>
builder.WithEnvironment("JAVA_TOOL_OPTIONS", "-Xmx768m");
}
Fixture.RestAddress is the REST address on the host. Operate is at {RestAddress}/operate; log
in with the fixture's Settings.Authentication.
Requirements
A Docker that Testcontainers can reach. The GitHub ubuntu-latest runner has one. Without Docker,
the fixture fails to start, and the whole test class fails with it. In the repository, these tests
carry [Trait("Requires", "Docker")], so a filter can leave them out where there is no Docker.
Without a license key, Camunda shows a "Non-Production License" banner. Its license allows that for testing.
The customer's workers in Docker: CamundaFixture
CamundaContainerFixture starts the Camunda alone, and the test mocks every job. To run the process with the
customer's own workers, declare them, and what they depend on, in the camunda section of testsettings.json, and use
CamundaFixture:
{
"camunda": {
"containers": {
"authentication": "basic",
"services": [
{ "name": "postgres", "image": "postgres:16", "environment": { "POSTGRES_PASSWORD": "test" },
"wait": { "port": 5432 } },
{ "name": "order-worker", "image": "shop/order-worker:1.4", "dependsOn": ["postgres"],
"environment": {
"Camunda__Url": "${camunda.restAddress}",
"ConnectionStrings__Orders": "Host=${postgres.host};Port=${postgres.port:5432};Password=test"
},
"wait": { "log": "Worker started" } }
]
}
}
}
public class OrderTests(CamundaFixture camunda)
: CamundaTestBase<CamundaFixture>(camunda), IClassFixture<CamundaFixture>
{
// The same chains: the jobs the list's workers serve are not mocked.
}
- One network, with the Camunda on it as
camunda, and the list started independsOnorder, each ready before the next. Testcontainers does not readdocker-compose: write the list once, from the system's compose file. - Every container gets the Camunda's address as
CAMUNDA_REST_ADDRESS,ZEEBE_REST_ADDRESSandZEEBE_GRPC_ADDRESS, and the mode asCAMUNDA_AUTH_STRATEGY. A worker that reads other names uses the placeholders${camunda.restAddress},${camunda.grpcAddress},${camunda.username}and${camunda.password}(Basic),${camunda.tokenUrl},${camunda.clientId},${camunda.clientSecret}and${camunda.audience}(OAuth),${<name>.host}and${<name>.port:<port>}. authentication:basic(the default) gives the workers and the test the samexunituser, with a new password on every run, inCAMUNDA_BASIC_AUTH_USERNAMEandCAMUNDA_BASIC_AUTH_PASSWORD;noneopens the API;oauthstarts a Keycloak, below.- Without
containers, the fixture runs on the cluster incamunda.restAddress; with neither, it fails, saying what to add.
OAuth: a Keycloak the fixture starts and configures
"containers": {
"authentication": "oauth",
"oauth": { "clientId": "order-worker", "clientSecret": "optional", "audience": "orchestration-api" },
"services": [ ... ]
}
The fixture starts camunda/keycloak:quay-26.6.4 on the network as keycloak, over https with the test authority,
and imports a camunda-platform realm it writes: the Camunda's client, the worker's (clientId, with clientSecret or
a new secret on every run) and the test's own, xunitassured-test, with client credentials, the audience (by default
orchestration-api) and a client_id claim. The Camunda validates the token by that Keycloak, and the worker gets:
| Family | Variables |
|---|---|
| Camunda SDK | CAMUNDA_AUTH_STRATEGY=OAUTH, CAMUNDA_OAUTH_URL, CAMUNDA_CLIENT_ID, CAMUNDA_CLIENT_SECRET, CAMUNDA_TOKEN_AUDIENCE |
| Camunda Spring SDK | CAMUNDA_CLIENT_AUTH_METHOD=oidc, CAMUNDA_CLIENT_AUTH_TOKENURL, CAMUNDA_CLIENT_AUTH_CLIENTID, CAMUNDA_CLIENT_AUTH_CLIENTSECRET, CAMUNDA_CLIENT_AUTH_AUDIENCE, CAMUNDA_CLIENT_RESTADDRESS, CAMUNDA_CLIENT_GRPCADDRESS |
| Zeebe Java client | ZEEBE_CLIENT_ID, ZEEBE_CLIENT_SECRET, ZEEBE_AUTHORIZATION_SERVER_URL, ZEEBE_TOKEN_AUDIENCE |
The token endpoint on the network is https://keycloak:8443/auth/realms/camunda-platform/protocol/openid-connect/token.
In this mode, keycloak is a reserved container name, and camunda and xunitassured-test are reserved client ids.
The Keycloak adds about a minute to the start-up.
What a worker has to accept: TLS from a test authority
The Camunda answers only https, with a certificate from an authority generated on every run. The fixture copies the
authority into every container at /xunitassured/tls/ca.pem and points the usual variables at it:
| Technology | Variable the fixture sets |
|---|---|
| OpenSSL (Go, .NET on Linux, curl) | SSL_CERT_FILE |
| Node | NODE_EXTRA_CA_CERTS |
| Python (requests) | REQUESTS_CA_BUNDLE |
| Camunda .NET SDK | CAMUNDA_MTLS_CA_PATH |
| Camunda Java client | ZEEBE_CA_CERTIFICATE_PATH |
| Spring Zeebe | CAMUNDA_CLIENT_CACERTIFICATEPATH (camunda.client.ca-certificate-path) |
| Java (any) | JAVA_TOOL_OPTIONS with -Djavax.net.ssl.trustStore=/xunitassured/tls/truststore.p12, its password and -Djavax.net.ssl.trustStoreType=PKCS12 |
A worker that reads another name uses ${camunda.caCertificatePath}, ${camunda.trustStorePath} and
${camunda.trustStorePassword}. A JAVA_TOOL_OPTIONS you declare keeps its options after the truststore's.
SSL_CERT_FILE, REQUESTS_CA_BUNDLE and the Java truststore replace the system's authorities: a worker that also
calls an external https service needs that service's authority added on its own (for example, a bundle of its own in
the list's environment).
Supported Frameworks
- .NET 8
- .NET 9
- .NET 10
License
MIT. Camunda itself is under the Camunda License 1.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- System.Security.Cryptography.Pkcs (>= 10.0.14)
- Testcontainers (>= 4.16.0)
- xunit.extensibility.core (>= 2.9.3)
- XUnitAssured.Camunda (>= 6.43.0)
-
net8.0
- System.Security.Cryptography.Pkcs (>= 10.0.14)
- Testcontainers (>= 4.16.0)
- xunit.extensibility.core (>= 2.9.3)
- XUnitAssured.Camunda (>= 6.43.0)
-
net9.0
- System.Security.Cryptography.Pkcs (>= 10.0.14)
- Testcontainers (>= 4.16.0)
- xunit.extensibility.core (>= 2.9.3)
- XUnitAssured.Camunda (>= 6.43.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.43.0 | 115 | 11/7/2026 |
| 6.42.0 | 106 | 11/6/2026 |
| 6.41.0 | 103 | 11/6/2026 |
| 6.40.0 | 100 | 11/6/2026 |
| 6.39.0 | 104 | 11/6/2026 |
| 6.38.0 | 102 | 11/5/2026 |
| 6.37.1 | 95 | 11/5/2026 |
| 6.37.0 | 92 | 11/5/2026 |
| 6.36.1 | 115 | 10/29/2026 |
| 6.36.0 | 125 | 10/18/2026 |
| 6.35.0 | 105 | 10/18/2026 |
| 6.34.0 | 102 | 10/18/2026 |
| 6.33.0 | 112 | 10/18/2026 |
| 6.32.0 | 106 | 10/17/2026 |
| 6.31.5 | 101 | 10/17/2026 |
| 6.31.4 | 100 | 10/17/2026 |
| 6.31.3 | 101 | 10/17/2026 |
| 6.31.2 | 104 | 10/17/2026 |
| 6.31.1 | 101 | 10/17/2026 |
| 6.31.0 | 102 | 10/16/2026 |
New in XUnitAssured.Camunda: CamundaHubClient, a client of the Camunda Hub (the Web Modeler) REST API, v1 and v2, with OAuth only: workspaces, projects, folders, files with their revision, and versions. No breaking changes. Release notes: https://github.com/andrewBezerra/xunit-assured-net/blob/main/docs/releases/6.43.0.md