use of org.bson.codecs.JsonObjectCodecProvider in project mongo-java-driver by mongodb.
the class JsonObjectTest method testToBsonDocument.
@Test
public void testToBsonDocument() {
JsonObject j1 = new JsonObject("{hello: 1}");
BsonDocument b1 = new BsonDocument("hello", new BsonInt32(1));
assertEquals(j1.toBsonDocument(null, fromProviders(new JsonObjectCodecProvider(), new BsonCodecProvider())), b1);
}
Aggregations