From 68dad1fc7d38a16b53344988e0ffac69780bb108 Mon Sep 17 00:00:00 2001 From: Jakob Edding <15202881+JakobEdding@users.noreply.github.com> Date: Fri, 12 Apr 2024 10:12:25 +0200 Subject: [PATCH] Add note about expectNextRecord to javadoc --- .../com/bakdata/fluent_kafka_streams_tests/BaseOutput.java | 5 ++++- .../com/bakdata/fluent_kafka_streams_tests/Expectation.java | 2 +- .../com/bakdata/fluent_kafka_streams_tests/TestOutput.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/BaseOutput.java b/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/BaseOutput.java index c08bf40..c79e865 100644 --- a/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/BaseOutput.java +++ b/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/BaseOutput.java @@ -76,7 +76,10 @@ public TestOutput withValueSerde(final Serde valueSerde) { } /** - * Reads the next record as creates an {@link Expectation} for it.
+ * Reads the next record and creates an {@link Expectation} for it.
+ * + * Note that calling `.expectNextRecord()` by itself without chaining at least one of the `.has*` methods will not + * check for the existence of a next record!
* * @return An {@link Expectation} containing the next record from the output.
*/ diff --git a/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/Expectation.java b/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/Expectation.java index c299e35..d10b017 100644 --- a/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/Expectation.java +++ b/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/Expectation.java @@ -113,7 +113,7 @@ public Expectation and() { } /** - *

Reads the next record as creates an {@code Expectation} for it.

+ *

Reads the next record and creates an {@code Expectation} for it.

*

This is logically equivalent to {@link TestOutput#expectNextRecord()}.

*

This methods main purpose is to allow chaining:

*
{@code
diff --git a/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/TestOutput.java b/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/TestOutput.java
index 87cfa35..8d18e69 100644
--- a/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/TestOutput.java
+++ b/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/TestOutput.java
@@ -118,7 +118,7 @@ default  TestOutput withValueType(final Class valueType) {
     ProducerRecord readOneRecord();
 
     /**
-     * Reads the next record as creates an {@link Expectation} for it.
+     * Reads the next record and creates an {@link Expectation} for it.
      *
      * @return An {@link Expectation} containing the next record from the output.
      */