DBZ-1925 Fix test regression after Confluent Platform 5.4.1 upgrade
This commit is contained in:
parent
80f3860b27
commit
5f8719f201
@ -23,12 +23,13 @@
|
||||
import org.apache.kafka.connect.header.Header;
|
||||
import org.apache.kafka.connect.header.Headers;
|
||||
import org.apache.kafka.connect.source.SourceRecord;
|
||||
import org.codehaus.jackson.JsonNode;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import io.debezium.config.Configuration;
|
||||
import io.debezium.connector.postgresql.PostgresConnectorConfig.SnapshotMode;
|
||||
import io.debezium.data.Json;
|
||||
@ -169,7 +170,7 @@ public void shouldSendEventTypeAsHeader() throws Exception {
|
||||
assertThat(routedEvent.headers().lastWithName("eventType").value()).isEqualTo("UserCreated");
|
||||
assertThat(value).isInstanceOf(String.class);
|
||||
JsonNode payload = (new ObjectMapper()).readTree((String) value);
|
||||
assertThat(payload.get("email").getTextValue()).isEqualTo("gh@mefi.in");
|
||||
assertThat(payload.get("email").asText()).isEqualTo("gh@mefi.in");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -192,7 +193,7 @@ public void shouldRespectJsonFormatAsString() throws Exception {
|
||||
Struct valueStruct = requireStruct(routedEvent.value(), "test payload");
|
||||
assertThat(valueStruct.getString("eventType")).isEqualTo("UserCreated");
|
||||
JsonNode payload = (new ObjectMapper()).readTree(valueStruct.getString("payload"));
|
||||
assertThat(payload.get("email").getTextValue()).isEqualTo("gh@mefi.in");
|
||||
assertThat(payload.get("email").asText()).isEqualTo("gh@mefi.in");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user