chia7712 commented on a change in pull request #9930:
URL: https://github.com/apache/kafka/pull/9930#discussion_r560206079
##########
File path:
streams/test-utils/src/test/java/org/apache/kafka/streams/test/TestRecordTest.java
##########
@@ -166,6 +166,9 @@ public void testProducerRecord() {
final TestRecord<String, Integer> testRecord = new
TestRecord<>(producerRecord);
final TestRecord<String, Integer> expectedRecord = new
TestRecord<>(key, value, headers, recordTime);
assertEquals(expectedRecord, testRecord);
- assertNotEquals(expectedRecord, producerRecord);
+ assertFalse(expectedRecord.getHeaders() == producerRecord.headers() &&
Review comment:
Could we separate this assert by ```assertEquals```? It can produce more
meaningful error message.
##########
File path:
streams/test-utils/src/test/java/org/apache/kafka/streams/test/TestRecordTest.java
##########
@@ -166,6 +166,9 @@ public void testProducerRecord() {
final TestRecord<String, Integer> testRecord = new
TestRecord<>(producerRecord);
final TestRecord<String, Integer> expectedRecord = new
TestRecord<>(key, value, headers, recordTime);
assertEquals(expectedRecord, testRecord);
- assertNotEquals(expectedRecord, producerRecord);
+ assertFalse(expectedRecord.getHeaders() == producerRecord.headers() &&
Review comment:
Also, it should make sure the input arguments (from
```ProducerRecord```) are equals to getter of ```TestRecord```. For example:
```java
assertEquals(expectedRecord.getHeaders(), producerRecord.headers())
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]