yuxiqian commented on code in PR #3707:
URL: https://github.com/apache/flink-cdc/pull/3707#discussion_r2051873897
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mongodb-cdc/src/test/java/org/apache/flink/cdc/connectors/mongodb/table/MongoDBTableFactoryTest.java:
##########
@@ -280,6 +286,99 @@ void testValidation() {
.hasStackTraceContaining("Unsupported options:\n\nunknown");
}
+ @Test
+ public void testCopyExistingPipelineConflictWithIncrementalSnapshotMode() {
+ // test with 'initial.snapshotting.pipeline' configuration
+ try {
+ Map<String, String> properties = getAllOptions();
+ properties.put("scan.incremental.snapshot.enabled", "true");
+ properties.put(
+ "initial.snapshotting.pipeline", "[{\"$match\":
{\"closed\": \"false\"}}]");
+
+ createTableSource(SCHEMA, properties);
+ } catch (Throwable t) {
+ Assertions.assertThat(
+ ExceptionUtils.findThrowableWithMessage(
+ t,
+ "The
initial.snapshotting.*/copy.existing.* config only applies to "
+ + "Debezium mode, not incremental
snapshot mode"))
+ .isPresent();
Review Comment:
This check will silently pass even if no exceptions are thrown. Favor
`assertThatThrownBy(...).rootCause().hasMessageContaining(...)`.
--
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]