Introduction
MassTransit makes it easier to build distributed applications using message-based communication. It provides consumers, publishers, message scheduling, retries, and saga state machines that help coordinate long-running business workflows. However, implementing a saga is only one part of building a reliable distributed system. Developers must also verify that the workflow behaves correctly when messages arrive, state transitions occur, and failures happen during processing.
Consider an order-processing application. When a customer places an order, the system may need to validate the order, reserve inventory, process payment, and arrange delivery. Each operation may run in a different service and may complete asynchronously. A saga state machine coordinates these operations by tracking the current state of the workflow and reacting to incoming messages.
A saga can work correctly during normal execution but still contain problems that appear only under specific conditions. For example, an order might move to the wrong state after receiving an unexpected event. A duplicate message might trigger an operation twice. A rejection event might fail to execute the expected compensation logic. These problems can be difficult to identify through manual testing.
MassTransit provides a Test Harness that helps developers test consumers and saga state machines without requiring a real message broker for every test. It uses an in-memory transport and can provide an in-memory saga repository, allowing developers to publish messages, observe consumed events, inspect saga instances, and verify state transitions.
In this article, we will build a simple order-processing saga and write automated tests for its state transitions, published messages, and failure scenarios. We will also discuss how to test a saga as part of an ASP.NET Core application.
Why Testing Saga State Machines Is Important
A normal unit test usually verifies the behavior of a single method or class. A saga state machine is more complicated because its behavior depends on messages received over time and the current state of a saga instance.
For example, an OrderSubmitted event may create a new saga instance. An OrderAccepted event should update that instance and move the workflow forward. An OrderRejected event may move the workflow into a cancellation state. The same event can have different results depending on the current saga state.
Testing only individual methods does not provide enough confidence that the complete workflow behaves correctly.
Saga testing helps verify several important areas:
- Saga creation: Confirm that the expected event creates a new saga instance.
- Message correlation: Confirm that messages with the same correlation identifier update the correct saga instance.
- State transitions: Confirm that the saga moves to the expected state after receiving an event.
- Published messages: Confirm that the saga publishes the correct event when a transition occurs.
- Failure handling: Confirm that rejection or failure events trigger the expected workflow behavior.
- Unexpected messages: Confirm that messages received in an unsupported state do not silently produce incorrect results.
These tests are especially important when a workflow contains multiple services. A small state-machine configuration mistake can affect the entire business process.
Understanding the MassTransit Test Harness
The MassTransit Test Harness is a testing utility designed to simplify automated testing of message-based applications. It provides an in-memory transport and exposes collections that allow tests to inspect messages that were consumed, published, or sent.
Instead of starting RabbitMQ or Azure Service Bus for every test, developers can configure the test harness with an in-memory transport. Messages are processed through MassTransit's normal consumer and saga infrastructure, but the test does not need an external message broker.
The test harness provides several useful capabilities:
- Publish messages directly to the test bus.
- Verify whether a message was consumed.
- Verify whether a message was published or sent.
- Retrieve consumer-specific test information.
- Access saga state machine test information.
- Inspect created saga instances.
- Verify state transitions.
- Test message correlation using identifiers.
The harness also supports asynchronous assertions. This is important because message processing does not necessarily finish immediately after a message is published. A test should wait for the expected message or state change rather than assuming that processing has completed.
The following table explains the main test harness collections.
| Collection | Purpose |
|---|
| Consumed | Verifies messages consumed by the bus |
| Published | Verifies messages published by the application |
| Sent | Verifies messages sent to an endpoint |
| Created | Helps verify saga instances created by a state machine |
| Events | Verifies events observed by a saga state machine |
| StateChanges | Verifies transitions between saga states |
The Events and StateChanges collections are available in newer MassTransit versions. If your project uses an older version, check the documentation for the APIs supported by that version.
Setting Up the Testing Project
Before writing tests, create a test project in your solution.
For example, an application might have the following structure:
OrderManagement
│
├── OrderManagement.Api
│ ├── Controllers
│ ├── Consumers
│ ├── Sagas
│ └── Program.cs
│
├── OrderManagement.Contracts
│ └── OrderMessages.cs
│
└── OrderManagement.Tests
├── SagaTests
└── OrderManagement.Tests.csproj
The application project contains the API and business workflow implementation. The contracts project contains message definitions shared by the application components. The test project contains automated tests for consumers and saga state machines.
Install the MassTransit testing package and the testing framework packages that match your project.
For example, with an NUnit-based test project:
dotnet add package MassTransit
dotnet add package MassTransit.TestFramework
dotnet add package NUnit
dotnet add package NUnit3TestAdapter
dotnet add package Microsoft.NET.Test.Sdk
Keep the MassTransit package versions aligned with the version used by the application. This avoids differences in test harness APIs and runtime behavior.
The examples in this article use the current container-based test harness approach with AddMassTransitTestHarness.
Creating the Order Message Contracts
First, define the messages that represent the events in the order workflow.
Create a file named OrderMessages.cs in the contracts project.
namespace OrderManagement.Contracts;
public record OrderSubmitted(
Guid CorrelationId,
string OrderNumber,
decimal Amount);
public record OrderAccepted(
Guid CorrelationId);
public record OrderRejected(
Guid CorrelationId,
string Reason);
public record OrderProcessingCompleted(
Guid CorrelationId,
string OrderNumber);
public record OrderProcessingCancelled(
Guid CorrelationId,
string Reason);
Each message contains a CorrelationId. MassTransit uses correlation identifiers to associate incoming messages with the correct saga instance.
For example, when an order is submitted, the state machine creates a saga instance using the correlation identifier from OrderSubmitted. When OrderAccepted arrives with the same identifier, MassTransit finds the existing instance and processes the event against it.
This is important because multiple orders may be processed at the same time. Without proper correlation, the application could update the wrong order workflow.
The message contracts also contain only the information required by the receiving components. A distributed application should avoid placing unnecessary application-specific data into shared message contracts.
Creating the Saga State
The saga state class stores the information required to track an order workflow.
Create an OrderState.cs file.
using MassTransit;
namespace OrderManagement.Sagas;
public class OrderState : SagaStateMachineInstance
{
public Guid CorrelationId { get; set; }
public string CurrentState { get; set; } = string.Empty;
public string OrderNumber { get; set; } = string.Empty;
public decimal Amount { get; set; }
public string? RejectionReason { get; set; }
}
The CorrelationId property identifies the saga instance. The CurrentState property stores the current state of the workflow. The remaining properties contain business information needed while processing the order.
For example, after receiving OrderSubmitted, the saga stores the order number and amount. If the order is rejected later, the saga can store the rejection reason.
Saga state should contain the information needed to coordinate the workflow, not every detail from every participating service. Large business records should generally remain in their respective services or databases. The saga should retain the identifiers and workflow data required to coordinate those services.
Creating the Order Saga State Machine
Now create the state machine that controls the order workflow.
Create an OrderStateMachine.cs file.
using MassTransit;
using OrderManagement.Contracts;
namespace OrderManagement.Sagas;
public class OrderStateMachine : MassTransitStateMachine<OrderState>
{
public State Submitted { get; private set; } = null!;
public State Completed { get; private set; } = null!;
public State Cancelled { get; private set; } = null!;
public Event<OrderSubmitted> OrderSubmitted { get; private set; } = null!;
public Event<OrderAccepted> OrderAccepted { get; private set; } = null!;
public Event<OrderRejected> OrderRejected { get; private set; } = null!;
public OrderStateMachine()
{
InstanceState(x => x.CurrentState);
Event(() => OrderSubmitted,
x => x.CorrelateById(context => context.Message.CorrelationId));
Event(() => OrderAccepted,
x => x.CorrelateById(context => context.Message.CorrelationId));
Event(() => OrderRejected,
x => x.CorrelateById(context => context.Message.CorrelationId));
Initially(
When(OrderSubmitted)
.Then(context =>
{
context.Saga.OrderNumber =
context.Message.OrderNumber;
context.Saga.Amount =
context.Message.Amount;
})
.TransitionTo(Submitted)
);
During(Submitted,
When(OrderAccepted)
.Publish(context =>
new OrderProcessingCompleted(
context.Saga.CorrelationId,
context.Saga.OrderNumber))
.TransitionTo(Completed),
When(OrderRejected)
.Then(context =>
{
context.Saga.RejectionReason =
context.Message.Reason;
})
.Publish(context =>
new OrderProcessingCancelled(
context.Saga.CorrelationId,
context.Message.Reason))
.TransitionTo(Cancelled)
);
}
}
Let's understand how this state machine works.
The InstanceState method tells MassTransit which property stores the current state of the saga. In this example, the CurrentState property stores the state name.
The Event configuration defines how each incoming message is correlated with a saga instance. The OrderSubmitted event creates a saga instance when a matching instance does not already exist. The other two events use the same correlation identifier to locate an existing instance.
The Initially section defines what happens when the saga receives its first event. When OrderSubmitted arrives, the state machine stores the order number and amount, then moves the saga into the Submitted state.
The During section defines the behavior while the saga is in the Submitted state. If OrderAccepted arrives, the state machine publishes OrderProcessingCompleted and moves the saga into Completed. If OrderRejected arrives, it stores the rejection reason, publishes OrderProcessingCancelled, and moves the saga into Cancelled.
The Completed and Cancelled states are regular saga states in this example. They are not automatically finalized simply because of their names. This is intentional: the example keeps the state available so tests can inspect the final business outcome. A production application should decide when a saga can be finalized and removed from its repository, especially when late messages, audit requirements, or recovery operations must be considered.
Writing the First Saga Test
Now that the state machine is ready, create a test that verifies whether an OrderSubmitted event creates a saga instance.
Create an OrderSagaTests.cs file.
using MassTransit;
using MassTransit.Testing;
using Microsoft.Extensions.DependencyInjection;
using NUnit.Framework;
using OrderManagement.Contracts;
using OrderManagement.Sagas;
namespace OrderManagement.Tests.SagaTests;
public class OrderSagaTests
{
[Test]
public async Task Should_Create_Saga_When_Order_Is_Submitted()
{
await using var provider = new ServiceCollection()
.AddMassTransitTestHarness(cfg =>
{
cfg.AddSagaStateMachine<
OrderStateMachine,
OrderState>()
.InMemoryRepository();
})
.BuildServiceProvider(true);
var harness = await provider.StartTestHarness();
var orderId = Guid.NewGuid();
await harness.Bus.Publish(new OrderSubmitted(
orderId,
"ORD-1001",
1500));
var sagaHarness = harness
.GetSagaStateMachineHarness<
OrderStateMachine,
OrderState>();
Assert.That(
await sagaHarness.Consumed.Any<OrderSubmitted>(
x => x.Context.Message.CorrelationId == orderId),
Is.True);
var saga = sagaHarness.Created
.ContainsInState(
orderId,
sagaHarness.StateMachine,
sagaHarness.StateMachine.Submitted);
Assert.That(saga, Is.Not.Null);
Assert.That(saga!.OrderNumber, Is.EqualTo("ORD-1001"));
Assert.That(saga.Amount, Is.EqualTo(1500));
}
}
This test creates a service provider and registers the order state machine with an in-memory saga repository. The test harness starts the bus and makes the state machine available for message processing.
The test then creates a new correlation identifier and publishes an OrderSubmitted event. It verifies that the state machine consumed the event and that a saga instance was created in the Submitted state.
The test also checks the order number and amount stored in the saga instance. This is important because verifying only that a message was consumed does not prove that the state machine stored the expected business information.
A test should verify the outcome that matters to the business workflow, not just the fact that a message entered the system.
Testing a Successful State Transition
The next test verifies that an order moves from Submitted to Completed when the saga receives OrderAccepted.
[Test]
public async Task Should_Complete_Order_When_Order_Is_Accepted()
{
await using var provider = new ServiceCollection()
.AddMassTransitTestHarness(cfg =>
{
cfg.AddSagaStateMachine<
OrderStateMachine,
OrderState>()
.InMemoryRepository();
})
.BuildServiceProvider(true);
var harness = await provider.StartTestHarness();
var orderId = Guid.NewGuid();
await harness.Bus.Publish(new OrderSubmitted(
orderId,
"ORD-1002",
2500));
await harness.Bus.Publish(new OrderAccepted(orderId));
var sagaHarness = harness
.GetSagaStateMachineHarness<
OrderStateMachine,
OrderState>();
var completedSaga = sagaHarness.Created
.ContainsInState(
orderId,
sagaHarness.StateMachine,
sagaHarness.StateMachine.Completed);
Assert.That(completedSaga, Is.Not.Null);
Assert.That(
await harness.Published.Any<OrderProcessingCompleted>(
x => x.Context.Message.CorrelationId == orderId),
Is.True);
}
This test publishes two events in sequence. The first event creates the saga instance and moves it into Submitted. The second event is correlated with that instance and triggers the successful transition.
The test verifies two separate outcomes.
First, it checks that the saga reached the Completed state. Second, it checks that the state machine published OrderProcessingCompleted with the correct correlation identifier.
Both assertions are useful because a state transition and a published event represent different parts of the workflow. A state machine might move into the expected state but fail to publish the required event because of an incorrect event configuration or publishing behavior.
Testing both outcomes gives better coverage of the business requirement.
Testing a Rejected Order
A distributed workflow must also handle failure scenarios. In this example, an order can be rejected while it is in the Submitted state.
The following test verifies that the saga moves into Cancelled and publishes the cancellation event.
[Test]
public async Task Should_Cancel_Order_When_Order_Is_Rejected()
{
await using var provider = new ServiceCollection()
.AddMassTransitTestHarness(cfg =>
{
cfg.AddSagaStateMachine<
OrderStateMachine,
OrderState>()
.InMemoryRepository();
})
.BuildServiceProvider(true);
var harness = await provider.StartTestHarness();
var orderId = Guid.NewGuid();
await harness.Bus.Publish(new OrderSubmitted(
orderId,
"ORD-1003",
3000));
await harness.Bus.Publish(new OrderRejected(
orderId,
"Insufficient inventory"));
var sagaHarness = harness
.GetSagaStateMachineHarness<
OrderStateMachine,
OrderState>();
var cancelledSaga = sagaHarness.Created
.ContainsInState(
orderId,
sagaHarness.StateMachine,
sagaHarness.StateMachine.Cancelled);
Assert.That(cancelledSaga, Is.Not.Null);
Assert.That(
cancelledSaga!.RejectionReason,
Is.EqualTo("Insufficient inventory"));
Assert.That(
await harness.Published.Any<OrderProcessingCancelled>(
x => x.Context.Message.CorrelationId == orderId),
Is.True);
}
This test verifies the failure path rather than only the successful path. It checks that the rejection reason is saved and that the cancellation event is published.
In a real application, cancellation may involve additional operations. For example, the workflow may need to release reserved inventory, refund a payment, or cancel a shipment. Those operations should be represented by appropriate commands and events, and their behavior should be tested separately.
A useful principle is to test every important business path through the saga, including successful completion, rejection, timeout, compensation, and recovery scenarios where applicable.
Testing Message Correlation
Message correlation is one of the most important parts of saga testing.
Imagine that two customers submit orders at almost the same time. The application creates two saga instances with different correlation identifiers. When an acceptance event arrives, it must update only the saga instance associated with that event.
A correlation problem can cause one customer's order to receive another customer's status update. This type of defect can be difficult to detect if tests use only one saga instance.
The following test creates two orders and accepts only one of them.
[Test]
public async Task Should_Update_Only_The_Matching_Saga()
{
await using var provider = new ServiceCollection()
.AddMassTransitTestHarness(cfg =>
{
cfg.AddSagaStateMachine<
OrderStateMachine,
OrderState>()
.InMemoryRepository();
})
.BuildServiceProvider(true);
var harness = await provider.StartTestHarness();
var firstOrderId = Guid.NewGuid();
var secondOrderId = Guid.NewGuid();
await harness.Bus.Publish(new OrderSubmitted(
firstOrderId,
"ORD-2001",
1000));
await harness.Bus.Publish(new OrderSubmitted(
secondOrderId,
"ORD-2002",
2000));
await harness.Bus.Publish(new OrderAccepted(firstOrderId));
var sagaHarness = harness
.GetSagaStateMachineHarness<
OrderStateMachine,
OrderState>();
var firstOrder = sagaHarness.Created
.ContainsInState(
firstOrderId,
sagaHarness.StateMachine,
sagaHarness.StateMachine.Completed);
var secondOrder = sagaHarness.Created
.ContainsInState(
secondOrderId,
sagaHarness.StateMachine,
sagaHarness.StateMachine.Submitted);
Assert.That(firstOrder, Is.Not.Null);
Assert.That(secondOrder, Is.Not.Null);
}
The test verifies that the first order moves into Completed while the second order remains in Submitted.
This confirms that the state machine uses the correlation identifier correctly. It also demonstrates why testing multiple saga instances is important. A test that creates only one saga instance may not reveal incorrect correlation behavior.
For production workflows, consider testing multiple concurrent instances, especially when the same state machine processes a large number of business transactions.
Testing State Transitions Directly
In addition to checking the current state of a saga instance, newer MassTransit test harness versions provide state transition information through the StateChanges collection.
This can make tests more precise because they can verify that a specific transition occurred.
For example, after publishing OrderSubmitted and OrderAccepted, a test can check whether the state machine moved from Submitted to Completed.
var sagaHarness = harness
.GetSagaStateMachineHarness<
OrderStateMachine,
OrderState>();
Assert.That(
await sagaHarness.StateChanges.Any(
sagaHarness.StateMachine.Submitted,
sagaHarness.StateMachine.Completed),
Is.True);
The Events collection can also be used to verify that the state machine observed a particular event.
Assert.That(
await sagaHarness.Events.Any<OrderAccepted>(),
Is.True);
These assertions are useful when a test needs to distinguish between message consumption and actual state-machine behavior.
For example, a message may be consumed by the bus but may not result in the expected state transition. Checking the state change helps identify that difference.
These APIs are version-dependent. Confirm that your installed MassTransit version supports them before adding these assertions to your test suite.
Testing Unexpected Messages
A saga should have clearly defined behavior for events received in an unexpected state.
For example, an OrderAccepted event received before OrderSubmitted cannot be correlated with an existing saga instance in this sample. The application should not assume that every event will arrive in the expected order.
There are several possible approaches to handling such situations:
- Configure the state machine to ignore an event when it is not valid in the current state.
- Publish an error or business notification when an unexpected event is received.
- Use an appropriate message retry or redelivery strategy when the event may become valid later.
- Store or defer the event when the business process requires out-of-order event handling.
The correct approach depends on the workflow. A message that is genuinely invalid should not be retried indefinitely. A message that arrived before a required event may need a different handling strategy.
Tests should verify the behavior that the business has chosen. Do not simply assert that an unexpected message is ignored unless ignoring it is the intended requirement.
Also remember that an event with an unknown correlation identifier and an event received in an existing saga's unsupported state are different situations. The state machine and repository configuration determine how those cases are handled.
Testing Sagas in an ASP.NET Core Application
Testing a state machine directly is useful, but it does not verify that the ASP.NET Core application is correctly connected to MassTransit.
For example, an API endpoint may accept an order request and publish OrderSubmitted. A saga test can verify the state machine, but it does not prove that the HTTP endpoint uses the correct message contract or publishes the expected event.
For this purpose, ASP.NET Core provides WebApplicationFactory through the Microsoft.AspNetCore.Mvc.Testing package. It allows tests to start an application in a test environment and send HTTP requests without deploying the application.
The MassTransit Test Harness can be registered in the test application's service collection.
A simplified example looks like this:
using MassTransit.Testing;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.DependencyInjection;
using NUnit.Framework;
[Test]
public async Task Should_Publish_Order_Submitted_From_Api()
{
await using var application =
new WebApplicationFactory<Program>()
.WithWebHostBuilder(builder =>
{
builder.ConfigureServices(services =>
{
services.AddMassTransitTestHarness();
});
});
var harness = application.Services.GetTestHarness();
using var client = application.CreateClient();
var orderId = Guid.NewGuid();
var response = await client.PostAsJsonAsync(
"/api/orders",
new
{
OrderId = orderId,
OrderNumber = "ORD-3001",
Amount = 4500
});
Assert.That(response.IsSuccessStatusCode, Is.True);
Assert.That(
await harness.Published.Any<OrderSubmitted>(
x => x.Context.Message.CorrelationId == orderId),
Is.True);
}
This example assumes that the API endpoint accepts the supplied request and publishes the OrderSubmitted contract. The application must also register its normal consumers and saga state machines in its service configuration.
When testing an existing ASP.NET Core application, verify that its production transport configuration is replaced appropriately for the test environment. Simply adding the test harness to an application that still starts a real RabbitMQ or Azure Service Bus connection may not give you the isolated in-memory test environment you expect.
A practical approach is to make transport configuration environment-aware or provide a test-specific service configuration that registers the in-memory transport and saga repository.
This type of test checks the integration between the HTTP endpoint, dependency injection, MassTransit publishing, and the message contract. It complements the direct state machine tests rather than replacing them.
Best Practices for Testing MassTransit Sagas
A reliable saga test suite should cover more than the normal successful workflow. The following practices help make tests useful and maintainable.
Use a Separate Test Harness for Each Scenario
A test harness tracks messages and asynchronous processing activity. Reusing the same harness across unrelated test scenarios can make assertions difficult to understand because messages from earlier operations may remain in its collections.
Create a fresh service provider and harness for each independent test. This keeps test results isolated and makes failures easier to troubleshoot.
Test Business Outcomes Instead of Only Message Consumption
Verifying that a message was consumed is not enough. A saga can consume an event without reaching the correct state or publishing the expected follow-up event.
Check the saga's state, important business properties, and published messages. These assertions provide stronger evidence that the workflow behaved correctly.
Use Unique Correlation Identifiers
Generate a new correlation identifier for each test scenario. This avoids accidental overlap between saga instances and makes it easier to identify which messages belong to a particular workflow.
When testing multiple orders, use separate identifiers and verify that each event updates only its matching saga.
Cover Failure and Recovery Paths
Include tests for rejected orders, payment failures, timeouts, compensation failures, and unexpected events where those scenarios are part of the workflow.
A saga that works only when every service succeeds is not sufficiently tested for production use.
Avoid Arbitrary Delays
Do not use Task.Delay to wait for message processing. A fixed delay may be too short on a slower machine and unnecessarily long on a faster one.
Use the asynchronous assertions provided by the test harness. They wait for the expected message or state observation within the configured test timeout.
Keep Test Timeouts Reasonable
The test harness has an overall test timeout and an inactivity timeout. The inactivity timeout controls how long message observation waits for additional activity, while the overall timeout limits the duration of test operations.
Configure these values when necessary, especially for tests that intentionally exercise longer workflows. Avoid setting extremely long timeouts for every test because they can make failures slow to detect.
Separate In-Memory Tests From Broker Integration Tests
The in-memory transport is excellent for testing state machine behavior and message flow. However, it does not prove that a production broker is configured correctly.
For example, it cannot fully validate RabbitMQ exchange declarations, broker permissions, network connectivity, or transport-specific delivery behavior.
Use in-memory tests for fast and repeatable workflow verification. Add a smaller number of integration tests with the actual broker when transport-specific behavior needs to be verified.
Common Mistakes to Avoid
Testing Only the Successful Workflow
A test suite that verifies only successful order processing may miss important defects in rejection, timeout, and compensation behavior.
Every significant business transition should have an associated test.
Assuming Message Publishing Means Processing Is Complete
Publishing a message is an asynchronous operation. The fact that Publish has completed does not necessarily mean that every consumer or saga has finished processing the message.
Use the test harness's asynchronous message and state assertions to verify the expected result.
Using the Wrong Correlation Identifier
If an event contains a different correlation identifier from the saga instance, MassTransit may not find the intended instance.
Always test that the identifiers in the message contracts match the saga's correlation configuration.
Ignoring the Difference Between In-Memory and Production Behavior
An in-memory test does not reproduce every behavior of RabbitMQ, Azure Service Bus, or another production transport.
Do not treat a passing in-memory test as proof that all broker configuration and delivery scenarios are correct.
Keeping Every Test in One Large Scenario
A single test that submits an order, accepts it, rejects another order, and checks several unrelated outcomes becomes difficult to maintain.
Keep tests focused on one business behavior. A focused test makes it easier to identify which state transition or message handling rule has failed.
Conclusion
Testing MassTransit saga state machines is an important part of building reliable distributed applications with ASP.NET Core. A saga coordinates business operations across multiple services, so developers must verify not only whether messages are consumed but also whether the correct saga instance is updated, the expected state transition occurs, and the required events are published.
MassTransit's Test Harness makes this process easier by providing an in-memory transport, saga repository support, and asynchronous message assertions. Developers can use it to test saga creation, successful transitions, rejection paths, message correlation, and published events without starting an external message broker for every test.
For larger applications, combine direct saga state machine tests with ASP.NET Core integration tests and a smaller set of tests against the actual message broker. This approach provides confidence at different levels of the application, from individual workflow transitions to HTTP endpoints and transport configuration.
A well-tested saga is easier to maintain, safer to extend, and more predictable when distributed services fail or messages arrive in unexpected conditions.
Join the conversation! Your thoughts help the community grow.