package org.infinispan.schematic.internal.document; import java.io.ByteArrayInputStream; import org.junit.Assert; import org.junit.Test; public class BsonWriterTest { @Test public void shouldReadArrayEditor() throws Exception { ArrayEditor arrayEditor = new ArrayEditor(new BasicArray("string"), null); BsonWriter writer = new BsonWriter(); byte[] bs = writer.write(arrayEditor); ByteArrayInputStream inputStream = new ByteArrayInputStream(bs); BsonReader reader = new BsonReader(); arrayEditor = (ArrayEditor) reader.read(inputStream); Assert.assertEquals("string", arrayEditor.get(0)); } }