All releases

v3.4.0

ready-sequence

Listener-ready tests, ordered snapshots, and choreography diagnostics.

Highlights

  • 01

    Listener readiness in topic assertions

    Wait for every @KafkaListener on an input topic, or for named listeners, before publishing. Existing topic reads remain explicit and do not wait implicitly.

    Read the guide →
  • 02

    Ordered and snapshot record assertions

    Use records(...).inOrder().containingExactly(...) or containsExactlyJson(...) with JsonPath exclusions for String, JSON DTO, and Avro payloads.

    Read the guide →
  • 03

    Multi-topic choreography checks

    Assert that a business key appears across every expected topic, with table-formatted failure diagnostics showing the first missing step.

    Read the guide →
  • 04

    Shared assertion diagnostics

    New table formatting makes ordered-record and choreography failures show what Kafka actually observed: index, topic or offset, key, and mismatch note.

    Read the guide →

Full notes

Added

  • KafkaTestListeners, a listener-readiness helper for waiting until Spring Kafka listener containers are running and assigned partitions.
  • KafkaTopicAssert.hasReadyListeners(), hasReadyListeners(Duration), hasReadyListener(id), and hasReadyListener(id, Duration) for explicit topic-level listener readiness checks.
  • KafkaTopicAssert.hasReadyListeners(ids...) and hasReadyListeners(Duration, ids...) for waiting on multiple named listeners subscribed to the asserted topic.
  • KafkaTopicAssert.records() and records(Class<V>) for ordered and snapshot-style assertions over String, JSON DTO, and Avro topic records.
  • KafkaRecordsAssert, with inOrder(), inAnyOrder(), containingExactly(...), ignoringJsonPaths(...), and containsExactlyJson(...).
  • KafkaChoreographyAssert and KafkaAssertions.assertThatChoreography() for key-scoped multi-topic flow assertions.
  • AssertionTableFormatter, a shared internal formatter for fixed-width assertion diagnostics.
  • Property spring.kafka.test.listeners.ready-timeout for configuring listener readiness timeout defaults.
  • Integration tests covering listener readiness chaining, multi-listener readiness, ordered records, snapshot JsonPath exclusions, Avro snapshots, and choreography diagnostics.

Changed

  • Bumped version to 3.4.0-SNAPSHOT.
  • Updated dependency examples in the README and docs to use io.gitlab.guisseppe:spring-kafka-test-utils:3.4.0.
  • Moved the website headline from dynamic bean overrides to listener readiness and snapshot/choreography assertions.
  • Updated topic assertion and API documentation with listener-aware chaining, record snapshots, and choreography examples.