-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preview feature to configure no op support based on CDC event type
basic unit test available but config tests missing
- Loading branch information
Showing
10 changed files
with
316 additions
and
7 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
15 changes: 15 additions & 0 deletions
15
src/main/java/at/grahsl/kafka/connect/mongodb/cdc/debezium/mongodb/MongoDbNoOp.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,15 @@ | ||
package at.grahsl.kafka.connect.mongodb.cdc.debezium.mongodb; | ||
|
||
import at.grahsl.kafka.connect.mongodb.cdc.CdcOperation; | ||
import at.grahsl.kafka.connect.mongodb.converter.SinkDocument; | ||
import com.mongodb.client.model.WriteModel; | ||
import org.bson.BsonDocument; | ||
|
||
public class MongoDbNoOp implements CdcOperation { | ||
|
||
@Override | ||
public WriteModel<BsonDocument> perform(SinkDocument doc) { | ||
return null; | ||
} | ||
|
||
} |
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
15 changes: 15 additions & 0 deletions
15
src/main/java/at/grahsl/kafka/connect/mongodb/cdc/debezium/rdbms/RdbmsNoOp.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,15 @@ | ||
package at.grahsl.kafka.connect.mongodb.cdc.debezium.rdbms; | ||
|
||
import at.grahsl.kafka.connect.mongodb.cdc.CdcOperation; | ||
import at.grahsl.kafka.connect.mongodb.converter.SinkDocument; | ||
import com.mongodb.client.model.WriteModel; | ||
import org.bson.BsonDocument; | ||
|
||
public class RdbmsNoOp implements CdcOperation { | ||
|
||
@Override | ||
public WriteModel<BsonDocument> perform(SinkDocument doc) { | ||
return null; | ||
} | ||
|
||
} |
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
24 changes: 24 additions & 0 deletions
24
src/test/java/at/grahsl/kafka/connect/mongodb/cdc/debezium/mongodb/MongoDbNoOpTest.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,24 @@ | ||
package at.grahsl.kafka.connect.mongodb.cdc.debezium.mongodb; | ||
|
||
import at.grahsl.kafka.connect.mongodb.converter.SinkDocument; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.platform.runner.JUnitPlatform; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertAll; | ||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
|
||
@RunWith(JUnitPlatform.class) | ||
public class MongoDbNoOpTest { | ||
|
||
@Test | ||
@DisplayName("when any cdc event then WriteModel is null resulting in Optional.empty() in the corresponding handler") | ||
public void testValidSinkDocument() { | ||
assertAll("test behaviour of MongoDbNoOp", | ||
() -> assertNull(new MongoDbNoOp().perform(new SinkDocument(null,null)),"MongoDbNoOp must result in null WriteModel"), | ||
() -> assertNull(new MongoDbNoOp().perform(null),"MongoDbNoOp must result in null WriteModel") | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.