Skip to content

#558 Fluent and type-safe testing DSL for kstreamplify-core-test - #562

Open
AnkurSinhaaa wants to merge 1 commit into
michelin:mainfrom
AnkurSinhaaa:feat-dsl-tests
Open

#558 Fluent and type-safe testing DSL for kstreamplify-core-test#562
AnkurSinhaaa wants to merge 1 commit into
michelin:mainfrom
AnkurSinhaaa:feat-dsl-tests

Conversation

@AnkurSinhaaa

Copy link
Copy Markdown
Contributor

Closes #558
Adds a fluent, type-safe Given → When → Then testing DSL to kstreamplify-core-test, available through a new test() method on KafkaStreamsStarterTest. Tests no longer need to declare and wire TestInputTopic/TestOutputTopic fields or read and assert records manually: the DSL reuses TopicWithSerde as the single source of topic and SerDe information and provides typed output assertions (hasExactly, containsKey, containsRecord, containsValue, containsHeader, containsExactly, satisfies, allSatisfy, ...), first-class DLQ assertions that hide the internal KafkaError behind a DlqRecord, state store assertions, multiple input topics via and(...), timestamped records, event-time and wall-clock control that preserves the Kafka Streams distinction between the two, chaining across several output topics, the DLQ and state stores in a single scenario, and failure messages reporting the topic, the expectation and the records actually produced. The change is purely additive — kstreamplify-core is untouched, existing tests and createInputTestTopic(...)/createOutputTestTopic(...) keep working, and driver() is exposed on every stage as an escape hatch to the underlying TopologyTestDriver. It comes with 70 unit tests covering every assertion and failure message over a topology exercising multiple inputs, DLQ routing, headers, a stream-table join, a state store and a wall-clock punctuator, plus a README section documenting the new recommended test style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fluent and type-safe testing DSL for kstreamplify-core-test

1 participant