litiliu commented on code in PR #8724:
URL: https://github.com/apache/seatunnel/pull/8724#discussion_r1955805805
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-kafka-e2e/src/test/java/org/apache/seatunnel/e2e/connector/kafka/KafkaIT.java:
##########
@@ -174,6 +174,35 @@ public void testSinkKafka(TestContainer container) throws
IOException, Interrupt
Assertions.assertEquals(10, data.size());
}
+ @TestTemplate
+ public void testNativeSinkKafka(TestContainer container)
+ throws IOException, InterruptedException {
+ Container.ExecResult execResult =
container.executeJob("/kafka_sink_fake_to_kafka.conf");
+ Assertions.assertEquals(0, execResult.getExitCode(),
execResult.getStderr());
+
+ String topicName = "test_topic";
+ String topicNativeName = "test_topic_native";
+ List<ConsumerRecord<String, String>> data =
getKafkaRecordData(topicName);
+
+ Container.ExecResult execResultNative =
container.executeJob("/kafka_native_to_kafka.conf");
+ Assertions.assertEquals(0, execResultNative.getExitCode(),
execResultNative.getStderr());
+
+ List<ConsumerRecord<String, String>> dataNative =
getKafkaRecordData(topicNativeName);
+
+ Assertions.assertEquals(dataNative.size(), data.size());
+
+ for (int i = 0; i < data.size(); i++) {
+ ConsumerRecord<String, String> oldRecord = data.get(i);
+ ConsumerRecord<String, String> newRecord = data.get(i);
+ Assertions.assertEquals(oldRecord.key(), newRecord.key());
+ Assertions.assertEquals(oldRecord.headers(), newRecord.headers());
+ Assertions.assertEquals(oldRecord.partition(),
newRecord.partition());
+ Assertions.assertEquals(oldRecord.timestamp(),
newRecord.timestamp());
+ Assertions.assertEquals(oldRecord.timestamp(),
newRecord.timestamp());
+ Assertions.assertEquals(oldRecord.value(), newRecord.value());
Review Comment:
Seems the oldRecord and newRecord are referring to the same object, what's
the meaning of those assertions?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]