JavaStreamingResponseDefinitionBuilder

Java-friendly wrapper around StreamingResponseDefinitionBuilder that returns this from every mutating method, enabling fluent chaining without Kotlin-specific idioms.

Java callers receive this type from JavaBuildingStep.respondsWithStream and use it to configure the streaming HTTP response for a stub:

mokksy.get(spec -> spec.path("/stream"))
.respondsWithStream(builder -> builder
.chunks(List.of("Hello", " ", "World"))
.delayBetweenChunksMillis(50));

Alternatively, supply chunks as a Stream:

mokksy.get(spec -> spec.path("/events"))
.respondsWithStream(builder -> builder
.chunks(Stream.of("data1", "data2")));

Type Parameters

P

The type of the request payload.

T

The type of each streamed chunk.

Functions

Link copied to clipboard

Appends a single chunk to the streaming response, preserving insertion order.

Link copied to clipboard

Sets the chunks to stream from a Stream.

Sets the chunks to stream from a List.

Link copied to clipboard

Sets the Content-Type of the streaming response.

Link copied to clipboard

Sets the delay between consecutive chunks.

Link copied to clipboard

Sets a delay before the response streaming begins.

Link copied to clipboard

Adds a response header.

Link copied to clipboard

Sets the HTTP status code.