testing-reactive-services

Test reactive Firefly services with StepVerifier, Testcontainers, and WebTestClient.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reactive services require robust testing across unit, integration, and controller layers. This Skill provides structured patterns, examples, and guidance to write effective tests for Firefly Framework's reactive components.

Core Features & Use Cases

  • StepVerifier-based unit tests for reactive methods and handlers.
  • Testcontainers-based integration tests for R2DBC databases, Kafka, and Redis.
  • WireMock-based mocking of external services and HTTP endpoints.
  • WebTestClient-driven controller tests and end-to-end verification.
  • Support for reactive context propagation and execution context testing.

Quick Start

Write a StepVerifier-based unit test first, then add Testcontainers-based integration tests as you expand coverage.

Frequently Asked Questions about testing-reactive-services

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

FAQPage Schema
How do I test reactive Spring WebFlux controllers with WebTestClient?

WebTestClient enables reactive controller testing by driving end-to-end verification for Spring WebFlux endpoints. It integrates with reactive patterns to validate HTTP responses asynchronously without blocking the test execution thread.

How to write unit tests for Project Reactor streams using StepVerifier?

StepVerifier tests reactive streams by asserting emitted elements and completion signals sequentially. You create a StepVerifier from a Flux or Mono, then define expectations for onNext, onError, and onComplete events to verify reactive logic deterministically.

Can I use Testcontainers for R2DBC integration tests with Kafka and Redis?

Testcontainers supports R2DBC integration testing by spinning up ephemeral database, Kafka, and Redis containers. This creates deterministic, environment-independent tests by validating reactive data flows against real infrastructure components isolated within Docker containers.

What's the best way to mock external HTTP services in reactive tests?

WireMock mocks external HTTP services in reactive tests by stubbing endpoint responses. It pairs with WebTestClient to verify how reactive handlers interact with downstream REST APIs, ensuring test isolation without relying on live third-party services.

Does this approach support reactive context propagation testing?

Reactive context propagation testing validates context transmission across asynchronous boundaries. This pattern verifies that execution context metadata persists correctly through Project Reactor streams during unit and integration tests.

Why do my reactive tests fail intermittently without Testcontainers?

Reactive tests fail intermittently without Testcontainers due to environment dependencies and timing inconsistencies. Using Testcontainers provides deterministic, isolated infrastructure for R2DBC and message brokers, eliminating flaky test results caused by shared or external environments.