@Test public void testSymbolType() throws IOException { BsonDocument bsonDoc = new BsonDocument(); bsonDoc.append("symbolKey", new BsonSymbol("test_symbol")); writer.reset(); bsonReader.write(writer, new BsonDocumentReader(bsonDoc)); SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader(); assertEquals("test_symbol", mapReader.reader("symbolKey").readText().toString()); }
@Override public BsonSymbol encode(Symbol object) { return new BsonSymbol(object.getSymbol()); }