DBZ-1508 Avoiding assertion based on platform-specific line endings

This commit is contained in:
Gunnar Morling 2019-09-26 09:23:40 +02:00
parent 0f61a0c8de
commit 236bae4265

View File

@ -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<Integer> values = document.getArray("my_field")
.streamValues()
.map(v -> v.asInteger())
.collect(Collectors.toList());
assertThat(values).containsExactly(1, 2, 3);
}
protected void assertPair( Iterator<Map.Entry<Path, Value>> iterator, String path, Object value ) {