use of org.bson.codecs.pojo.PojoCodecProvider in project mongo-java-driver by mongodb.
the class AbstractUuidRepresentationTest method setUp.
@Before
public void setUp() {
PojoCodecProvider pojoCodecProvider = PojoCodecProvider.builder().automatic(true).build();
CodecRegistry codecRegistry = fromRegistries(getDefaultCodecRegistry(), fromProviders(pojoCodecProvider));
createMongoClient(uuidRepresentation, codecRegistry);
MongoDatabase database = getDatabase(getDefaultDatabaseName());
documentCollection = database.getCollection(getClass().getName());
dbObjectCollection = documentCollection.withDocumentClass(DBObject.class);
uuidIdPojoCollection = documentCollection.withDocumentClass(UuidIdPojo.class);
bsonDocumentCollection = getMongoClient().getDatabase(getDefaultDatabaseName()).getCollection(getClass().getName()).withDocumentClass(BsonDocument.class);
bsonDocumentCollection.drop();
}
Aggregations