testing-sagas

Automates end-to-end saga tests and compensation verification for Firefly Framework.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/fireflyframework/fireflyframework-claude-skills --skill testing-sagas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-sagas
Source: https://github.com/fireflyframework/fireflyframework-claude-skills/tree/main/skills/testing-sagas
Command: npx skills add https://github.com/fireflyframework/fireflyframework-claude-skills --skill testing-sagas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and validating complex saga orchestration tests is error-prone due to multi-step compensation, policy variations, and external service interactions. This skill provides a comprehensive framework and examples for building lightweight SagaEngine tests, verifying happy paths, per-step compensations, and persistence checks.

Core Features & Use Cases

  • Test infrastructure for saga testing using SagaEngine with lightweight components (no Spring context).
  • Examples for building sagas via SagaBuilder, executing with StepInputs, and validating results with StepVerifier.
  • Coverage of compensation scenarios: per-step compensation, compensation policies, error handling, mocks of external services, and lifecycle callbacks.
  • Persistence checkpoint verification, expand-expand patterns, and layer/concurrency considerations.

Quick Start

Create a saga with multiple steps, simulate a failure at a chosen step, and verify corresponding compensations using StepVerifier.

Frequently Asked Questions about testing-sagas

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test saga compensation flows and rollback policies end-to-end?

Saga compensation flows are tested by building sagas with SagaBuilder, executing them with StepInputs, and validating rollback policies and per-step compensations using StepVerifier across SagaEngine workflows.

What is the best way to verify saga persistence checkpoints and external service mocks?

Saga persistence checkpoints and external service mocks are verified using Mockito-based mocks and optional persistence components to validate state transitions and checkpoint integrity across SagaEngine workflows.

Do I need a Spring context to run saga tests with StepVerifier?

No Spring context is needed to run saga tests. The testing infrastructure uses lightweight SagaEngine components, SagaBuilder, and StepVerifier to construct and validate sagas without loading a full application context.

How do I simulate a step failure and validate per-step compensation in a saga?

To simulate a step failure and validate per-step compensation, create a multi-step saga with SagaBuilder, trigger a failure at a chosen step using StepInputs, and assert the corresponding compensations with StepVerifier.

Can I test expand-expand patterns and lifecycle callbacks in saga orchestration?

Yes, expand-expand patterns and lifecycle callbacks can be tested. The skill covers compensation scenarios, error handling, and concurrency considerations to validate complex saga orchestration behaviors and callback executions.

Why does testing saga orchestration require mocking external services?

Mocking external services is required because saga orchestration involves multi-step interactions and policy variations. Mockito-based mocks isolate workflow behavior, enabling accurate compensation verification and persistence validation without external dependencies.