#558 Fluent and type-safe testing DSL for kstreamplify-core-test - #562
Open
AnkurSinhaaa wants to merge 1 commit into
Open
#558 Fluent and type-safe testing DSL for kstreamplify-core-test#562AnkurSinhaaa wants to merge 1 commit into
AnkurSinhaaa wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.