|
10 | 10 | import static io.airbyte.integrations.source.mysql.MySqlSource.CDC_DEFAULT_CURSOR;
|
11 | 11 | import static io.airbyte.integrations.source.mysql.MySqlSource.CDC_LOG_FILE;
|
12 | 12 | import static io.airbyte.integrations.source.mysql.MySqlSource.CDC_LOG_POS;
|
| 13 | +import static io.airbyte.integrations.source.mysql.MySqlSpecConstants.FAIL_SYNC_OPTION; |
13 | 14 | import static io.airbyte.integrations.source.mysql.cdc.MysqlCdcStateConstants.IS_COMPRESSED;
|
14 | 15 | import static io.airbyte.integrations.source.mysql.cdc.MysqlCdcStateConstants.MYSQL_CDC_OFFSET;
|
15 | 16 | import static io.airbyte.integrations.source.mysql.cdc.MysqlCdcStateConstants.MYSQL_DB_HISTORY;
|
|
20 | 21 | import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
21 | 22 | import static org.junit.jupiter.api.Assertions.assertNotNull;
|
22 | 23 | import static org.junit.jupiter.api.Assertions.assertNull;
|
| 24 | +import static org.junit.jupiter.api.Assertions.assertThrows; |
23 | 25 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
24 | 26 |
|
25 | 27 | import com.fasterxml.jackson.databind.JsonNode;
|
|
33 | 35 | import io.airbyte.cdk.db.jdbc.JdbcDatabase;
|
34 | 36 | import io.airbyte.cdk.integrations.debezium.CdcSourceTest;
|
35 | 37 | import io.airbyte.cdk.integrations.debezium.internals.AirbyteSchemaHistoryStorage;
|
| 38 | +import io.airbyte.commons.exceptions.ConfigErrorException; |
36 | 39 | import io.airbyte.commons.json.Jsons;
|
37 | 40 | import io.airbyte.commons.util.AutoCloseableIterator;
|
38 | 41 | import io.airbyte.commons.util.AutoCloseableIterators;
|
@@ -277,6 +280,12 @@ protected void syncShouldHandlePurgedLogsGracefully() throws Exception {
|
277 | 280 | dataFromSecondBatch);
|
278 | 281 | assertEquals((recordsToCreate * 2) + recordsCreatedBeforeTestCount, recordsFromSecondBatch.size(),
|
279 | 282 | "Expected 46 records to be replicated in the second sync.");
|
| 283 | + |
| 284 | + JsonNode failSyncConfig = testdb.testConfigBuilder() |
| 285 | + .withCdcReplication(FAIL_SYNC_OPTION) |
| 286 | + .with(SYNC_CHECKPOINT_RECORDS_PROPERTY, 1) |
| 287 | + .build(); |
| 288 | + assertThrows(ConfigErrorException.class, () -> source().read(failSyncConfig, getConfiguredCatalog(), state)); |
280 | 289 | }
|
281 | 290 |
|
282 | 291 | /**
|
|
0 commit comments