Skip to content
Bluetape4k docs1.11

WebFlux Mock Server

Latest stable Based on Bluetape4k release 1.11.0

A standalone Spring Boot 4 + WebFlux mock server for integration testing. It provides HTTP endpoints compatible with httpbin.org and jsonplaceholder.typicode.com, implemented with Kotlin Coroutines (suspend fun, Flow). This manual connects that purpose to the current build, source entry points, tests, configuration resources, and lifecycle evidence instead of duplicating the README feature list.

Use bluetape4k-mock-webflux-server when the application needs fixture ownership, isolation, deterministic cleanup, and failure diagnostics. Start with the source entry points below and confirm that their ownership and failure contracts match the calling component. Prefer a smaller standard-library or already-adopted module when it satisfies the same contract without another runtime boundary.

dependencies {
implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<version>"))
implementation("io.github.bluetape4k:bluetape4k-mock-webflux-server")
}

Gradle project path: :bluetape4k-mock-webflux-server. Source directory: testing/mock-webflux-server.

The first source-level concepts to inspect are MockWebfluxServerApplication, AdminController, PingController, GlobalExceptionHandler, HttpsServerLifecycle, WebFluxJacksonConfig, HttpbinAdvancedController, and HttpbinController. File names are navigation anchors; read each declaration and its tests before treating it as a public contract.

Add the coordinate above, refresh Gradle, and start from the smallest entry point that owns the required task. Open MockWebfluxServerApplication first; it is a concrete source entry point for the module.

Entry pointWhat to verify
MockWebfluxServerApplicationInspect this declaration’s constructors, functions, and ownership contract.
AdminControllerInspect this declaration’s constructors, functions, and ownership contract.
PingControllerInspect this declaration’s constructors, functions, and ownership contract.
GlobalExceptionHandlerInspect this declaration’s constructors, functions, and ownership contract.
HttpsServerLifecycleInspect this declaration’s constructors, functions, and ownership contract.
WebFluxJacksonConfigInspect this declaration’s constructors, functions, and ownership contract.
HttpbinAdvancedControllerInspect this declaration’s constructors, functions, and ownership contract.
HttpbinControllerInspect this declaration’s constructors, functions, and ownership contract.
HttpbinStreamControllerInspect this declaration’s constructors, functions, and ownership contract.
HttpbinSupportInspect this declaration’s constructors, functions, and ownership contract.

The README evidence is organized around Architecture, Comparison with bluetape4k-mock-web-server, Diagrams, Request Routing Overview, Class Diagram, Sequence Diagram — httpbin GET, Features, Configuration, Examples, and Run via Docker. Use those topics as a navigation map, then confirm behavior in source and tests. Keep adoption narrow and connect owned resources to the caller lifecycle.

The current build declares these integration edges:

implementation(platform(libs.spring.boot.dependencies))
implementation(platform(libs.jackson3.bom))
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-cache")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation(libs.caffeine)
implementation(libs.jackson3.module.kotlin)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.reactor)
implementation(project(":bluetape4k-core"))
implementation(project(":bluetape4k-coroutines"))
implementation(project(":bluetape4k-logging"))

Treat compileOnly edges as caller-provided capabilities and verify runtime availability before using their APIs.

Configuration resources found in the module:

Read property names and defaults from these resources and the binding source before overriding them.

Failure semantics are defined by the linked entry points and tests, not inferred from the artifact name. Keep cancellation and timeout signals intact, close owned resources, and translate backend exceptions only at a boundary that can add a stable domain contract. Use the test anchors below to verify the exact behavior before adding retries or fallbacks.

Keep fixtures isolated, bound resource use, expose diagnostics, and close shared services deterministically. Keep capacity, timeout, retry, and shutdown settings next to the component that owns the resource; avoid process-wide defaults that hide which caller accepted the trade-off.

Run the module test task:

Terminal window
./gradlew :bluetape4k-mock-webflux-server:test --no-configuration-cache

Representative test anchors:

No dedicated workshop path is registered in the manual manifest. Use the module README and the representative tests above as runnable evidence.

This page documents the repository state represented by the linked source and tests. It does not turn optional backends into application defaults or claim performance without a benchmark artifact. Re-check compatibility and lifecycle notes when the module version changes.

These diagrams are loaded directly from README assets published with the 1.11.0 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.

Mock WebFlux Server routing overview

Release README: testing/mock-webflux-server/README.md

Mock WebFlux Server class structure

Release README: testing/mock-webflux-server/README.md

WebFlux httpbin GET request sequence

Release README: testing/mock-webflux-server/README.md