XUnitAssured.Camunda.Testcontainers
6.31.1
dotnet add package XUnitAssured.Camunda.Testcontainers --version 6.31.1
NuGet\Install-Package XUnitAssured.Camunda.Testcontainers -Version 6.31.1
<PackageReference Include="XUnitAssured.Camunda.Testcontainers" Version="6.31.1" />
<PackageVersion Include="XUnitAssured.Camunda.Testcontainers" Version="6.31.1" />
<PackageReference Include="XUnitAssured.Camunda.Testcontainers" />
paket add XUnitAssured.Camunda.Testcontainers --version 6.31.1
#r "nuget: XUnitAssured.Camunda.Testcontainers, 6.31.1"
#:package XUnitAssured.Camunda.Testcontainers@6.31.1
#addin nuget:?package=XUnitAssured.Camunda.Testcontainers&version=6.31.1
#tool nuget:?package=XUnitAssured.Camunda.Testcontainers&version=6.31.1
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. - 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 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.
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
- Testcontainers (>= 4.16.0)
- xunit.extensibility.core (>= 2.9.3)
- XUnitAssured.Camunda (>= 6.31.1)
-
net8.0
- Testcontainers (>= 4.16.0)
- xunit.extensibility.core (>= 2.9.3)
- XUnitAssured.Camunda (>= 6.31.1)
-
net9.0
- Testcontainers (>= 4.16.0)
- xunit.extensibility.core (>= 2.9.3)
- XUnitAssured.Camunda (>= 6.31.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
New package XUnitAssured.Camunda: deploy BPMN, start real Camunda 8.10 process instances on a shared cluster and mock the diagram's job workers per instance, with assertions that wait for the cluster. The other packages are unchanged from 6.19.1. Upgrade guide: https://github.com/andrewBezerra/xunit-assured-net/blob/main/UPGRADING.md