use of org.eclipse.hono.deviceregistry.mongodb.model.MongoDbBasedCredentialsDao in project hono by eclipse.
the class MongoDbTestUtils method getCredentialsDao.
/**
* Creates a new Credentials DAO.
*
* @param vertx The vert.x instance to run on.
* @param dbName The name of the database to connect to.
* @return The DAO.
* @throws NullPointerException if any of the parameters are {@code null}.
*/
public static MongoDbBasedCredentialsDao getCredentialsDao(final Vertx vertx, final String dbName) {
final JsonObject mongoDbConfig = new MongoDbConfigProperties().setConnectionString(MONGO_DB_CONTAINER.getReplicaSetUrl(dbName)).getMongoClientConfig();
LOG.info("creating Mongo DB client for credentials DAO using config:{}{}]", System.lineSeparator(), mongoDbConfig.encodePrettily());
return new MongoDbBasedCredentialsDao(getMongoClient(vertx, mongoDbConfig), "credentials", null, null);
}
Aggregations