public static MongoDatabase createDatabaseProxy(final MongoDatabase database) {
		if (DISABLED) {
			return database;
		}
		SERVICES_COUNTER.setDisplayed(!COUNTER_HIDDEN);
		SERVICES_COUNTER.setUsed(true);
		return JdbcWrapper.createProxy(database, new MongoDatabaseHandler(database));
	}
@Test
	public void testCreateDatabaseProxy() {
		try {
			Class.forName("com.mongodb.ReadPreference");
		} catch (final ClassNotFoundException e) {
			LogManager.getRootLogger().info(e.toString());
			// si mongodb-driver-core n'est pas disponible dans le classpath (test depuis Ant),
			// on ne peut pas exécuter ce test
			return;
		}
		final MongoDatabase database = createNiceMock(MongoDatabase.class);
		final MongoCollection<Document> collection = createNiceMock(MongoCollection.class);
		final CodecRegistry codecRegistry = createNiceMock(CodecRegistry.class);
		expect(database.withCodecRegistry(codecRegistry)).andReturn(database).anyTimes();
		expect(database.getCollection("collection")).andReturn(collection).anyTimes();
		expect(database.getName()).andReturn("db").anyTimes();
		expect(collection.withCodecRegistry(codecRegistry)).andReturn(collection).anyTimes();

		replay(database);
		replay(collection);
		replay(codecRegistry);
		final MongoDatabase databaseProxy = MongoWrapper.createDatabaseProxy(database);
		assertNotNull("createDatabaseProxy", databaseProxy);
		assertNotNull("databaseProxy", databaseProxy.withCodecRegistry(codecRegistry));
		assertNotNull("getCollection", databaseProxy.getCollection("collection"));
		assertEquals("getName", "db", databaseProxy.getName());

		assertNotNull("collectionProxy",
				databaseProxy.getCollection("collection").withCodecRegistry(codecRegistry));
		databaseProxy.getCollection("collection").getCodecRegistry();
		databaseProxy.getCollection("collection").find();
		verify(database);
		verify(collection);
		verify(codecRegistry);
	}