github-actions[bot] commented on code in PR #40785:
URL: https://github.com/apache/beam/pull/40785#discussion_r4370009249
##########
sdks/java/io/debezium/src/test/java/org/apache/beam/io/debezium/SourceRecordJsonTest.java:
##########
@@ -90,6 +123,16 @@ public void testFullMetadata() {
+ "\"op\":\"u\",\"ts_ms\":1791689147000,\"lsn\":37094192},"
+ "\"before\":null,\"after\":{\"fields\":{\"id\":1001}}}",
new SourceRecordJson(buildEnvelopeRecord(postgresSource(), "u"),
true).toJson());
+
+ // With provide.transaction.metadata, the envelope's transaction block is
included.
+ assertEquals(
+
"{\"metadata\":{\"connector\":\"postgresql\",\"version\":\"3.5.2.Final\",\"name\":\"n\","
+ +
"\"database\":\"postgres\",\"schema\":\"inventory\",\"table\":\"customers\","
+ + "\"op\":\"c\",\"ts_ms\":1791689147000,\"lsn\":37094192,"
+ + "\"transaction\":{\"id\":\"796:48630784\",\"total_order\":1,"
+ + "\"data_collection_order\":1}},"
+ + "\"before\":null,\"after\":{\"fields\":{\"id\":1001}}}",
+ new SourceRecordJson(transactionRecord, true).toJson());
Review Comment:
**🟡 Medium**: `testFullMetadata` verifies the `transaction` block on data
change events, but there is no unit test in `SourceRecordJsonTest` covering
transaction `BEGIN` and `END` events (`isTransactionMetadataEvent` and
`loadTransactionMetadata()`). Consider adding a unit test with
`io.debezium.connector.common.TransactionMetadataKey` records (both `BEGIN`
with null `event_count`/`data_collections` and `END` with populated
`data_collections`) so this code path is tested without requiring the
Docker-based integration test.
--
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]