-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added mysql test * added mysql test * added mysql test * added mysql test
- Loading branch information
1 parent
0cf8f68
commit 65508b6
Showing
10 changed files
with
180 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
...berg-sink/src/test/java/io/debezium/server/iceberg/BatchSparkChangeConsumerMysqlTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* | ||
* * Copyright memiiso Authors. | ||
* * | ||
* * Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
*/ | ||
|
||
package io.debezium.server.iceberg; | ||
|
||
import io.debezium.server.testresource.BaseSparkTest; | ||
import io.debezium.server.testresource.S3Minio; | ||
import io.debezium.server.testresource.SourceMysqlDB; | ||
import io.debezium.util.Testing; | ||
import io.quarkus.test.common.QuarkusTestResource; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.quarkus.test.junit.TestProfile; | ||
|
||
import java.time.Duration; | ||
|
||
import org.apache.spark.sql.Dataset; | ||
import org.apache.spark.sql.Row; | ||
import org.awaitility.Awaitility; | ||
import org.eclipse.microprofile.config.inject.ConfigProperty; | ||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Integration test that verifies basic reading from PostgreSQL database and writing to s3 destination. | ||
* | ||
* @author Ismail Simsek | ||
*/ | ||
@QuarkusTest | ||
@QuarkusTestResource(S3Minio.class) | ||
@QuarkusTestResource(SourceMysqlDB.class) | ||
@TestProfile(BatchSparkChangeConsumerMysqlTestProfile.class) | ||
public class BatchSparkChangeConsumerMysqlTest extends BaseSparkTest { | ||
|
||
|
||
@ConfigProperty(name = "debezium.source.max.batch.size", defaultValue = "1000") | ||
Integer maxBatchSize; | ||
|
||
@Test | ||
public void testSimpleUpload() { | ||
Testing.Print.enable(); | ||
|
||
Awaitility.await().atMost(Duration.ofSeconds(60)).until(() -> { | ||
try { | ||
Dataset<Row> df = getTableData("testc.inventory.customers"); | ||
df.show(false); | ||
return df.filter("id is not null").count() >= 4; | ||
} catch (Exception e) { | ||
return false; | ||
} | ||
}); | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
...nk/src/test/java/io/debezium/server/iceberg/BatchSparkChangeConsumerMysqlTestProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* | ||
* * Copyright memiiso Authors. | ||
* * | ||
* * Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
*/ | ||
|
||
package io.debezium.server.iceberg; | ||
|
||
import io.quarkus.test.junit.QuarkusTestProfile; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class BatchSparkChangeConsumerMysqlTestProfile implements QuarkusTestProfile { | ||
|
||
//This method allows us to override configuration properties. | ||
@Override | ||
public Map<String, String> getConfigOverrides() { | ||
Map<String, String> config = new HashMap<>(); | ||
config.put("quarkus.profile", "mysql"); | ||
config.put("%mysql.debezium.source.connector.class", "io.debezium.connector.mysql.MySqlConnector"); | ||
return config; | ||
} | ||
|
||
@Override | ||
public String getConfigProfile() { | ||
return "mysql"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters