From 236bae4265c03fbb04772c5cf3f9313812ed59c1 Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Thu, 26 Sep 2019 09:23:40 +0200 Subject: [PATCH] DBZ-1508 Avoiding assertion based on platform-specific line endings --- .../java/io/debezium/document/DocumentTest.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/debezium-core/src/test/java/io/debezium/document/DocumentTest.java b/debezium-core/src/test/java/io/debezium/document/DocumentTest.java index daee7fbc0..91e3f4bce 100644 --- a/debezium-core/src/test/java/io/debezium/document/DocumentTest.java +++ b/debezium-core/src/test/java/io/debezium/document/DocumentTest.java @@ -9,7 +9,9 @@ import java.util.Iterator; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import org.junit.Before; import org.junit.Test; @@ -49,11 +51,13 @@ public void shouldCreateArrayFromValues() { Document document = Document.create(); document.setArray("my_field", 1, 2, 3); - assertThat(document.toString()).isEqualTo( - "{\n" + - " \"my_field\" : [ 1, 2, 3 ]\n" + - "}" - ); + assertThat(document.has("my_field")).isTrue(); + assertThat(document.size()).isEqualTo(1); + List values = document.getArray("my_field") + .streamValues() + .map(v -> v.asInteger()) + .collect(Collectors.toList()); + assertThat(values).containsExactly(1, 2, 3); } protected void assertPair( Iterator> iterator, String path, Object value ) {