DBZ-1717 Misc. clean-up;

* Expanding test
* Removing obsolete deprecation warning
* Adding Jan Uyttenhove to COPYRIGHT.txt
This commit is contained in:
Gunnar Morling 2020-01-28 10:34:44 +01:00 committed by Jiri Pechanec
parent 144936363f
commit d5bbc7a123
3 changed files with 17 additions and 8 deletions

View File

@ -66,6 +66,7 @@ Ivan Luzyanin
Ivan San Jose
Ivan Vucina
Jakub Cechacek
Jan Uyttenhove
Jaromir Hamala
Javier Holguera
Jeremy Finzel

View File

@ -8,6 +8,10 @@
import static org.fest.assertions.Assertions.assertThat;
import java.io.IOException;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -80,8 +84,17 @@ public void shouldTransformEvents() throws InterruptedException, IOException {
// Test insert
primary().execute("insert", client -> {
long timestamp = ZonedDateTime.of(2020, 1, 28, 10, 00, 33, 0, ZoneId.of("UTC")).toEpochSecond();
client.getDatabase(DB_NAME).getCollection(this.getCollectionName())
.insertOne(Document.parse("{'_id': 1, 'dataStr': 'hello', 'dataInt': 123, 'dataLong': 80000000000}"));
.insertOne(Document.parse(
"{"
+ " '_id': 1, "
+ " 'dataStr': 'hello', "
+ " 'dataInt': 123, "
+ " 'dataLong': 80000000000, "
+ " 'dataDate': ISODate(\"2020-01-27T10:47:12.311Z\"), "
+ " 'dataTimestamp': Timestamp(" + timestamp + ", 1)" // seconds since epoch, operation counter within second
+ "}"));
});
SourceRecords records = consumeRecordsByTopic(1);
@ -99,6 +112,8 @@ public void shouldTransformEvents() throws InterruptedException, IOException {
assertThat(transformedInsertValue.get("dataStr")).isEqualTo("hello");
assertThat(transformedInsertValue.get("dataInt")).isEqualTo(123);
assertThat(transformedInsertValue.get("dataLong")).isEqualTo(80_000_000_000l);
assertThat(transformedInsertValue.get("dataDate")).isEqualTo(Date.from(Instant.from(ZonedDateTime.of(2020, 1, 27, 10, 47, 12, 311000000, ZoneId.of("UTC")))));
assertThat(transformedInsertValue.get("dataTimestamp")).isEqualTo(Date.from(Instant.from(ZonedDateTime.of(2020, 1, 28, 10, 00, 33, 0, ZoneId.of("UTC")))));
// Test update
primary().execute("update", client -> {

View File

@ -20,13 +20,6 @@ This SMT is supported only for the MongoDB connector.
See xref:configuration/event-flattening.adoc[here] for the relational database equivalent to this SMT.
====
[WARNING]
====
0.9.0 Backwards compatible breaking changes
Breaking changes were introduced together with handling deletions features, the previous default behavior was to keep deletion messages, now the new default behavior is to remove them. To change this setting please refer to link:#configuration_options[`delete.handling.mode`] and link:#configuration_options[`drop.tombstones`]
====
The Debezium MongoDB connector generates the data in a form of a complex message structure.
The message consists of two parts: