public class MongodForTestsFactory extends Object
| Constructor and Description |
|---|
MongodForTestsFactory()
Create the testing utility using the latest production version of
MongoDB.
|
MongodForTestsFactory(IFeatureAwareVersion version)
Create the testing utility using the specified version of MongoDB.
|
| Modifier and Type | Method and Description |
|---|---|
com.mongodb.client.MongoDatabase |
newDatabase(com.mongodb.MongoClient mongo)
Creates a new DB with unique name for connection.
|
com.mongodb.DB |
newDB(com.mongodb.Mongo mongo)
Deprecated.
|
com.mongodb.MongoClient |
newMongo()
Creates a new Mongo connection.
|
protected MongodConfig |
newMongodConfig(IFeatureAwareVersion version) |
void |
shutdown()
Cleans up the resources created by the utility.
|
static MongodForTestsFactory |
with(IFeatureAwareVersion version) |
public MongodForTestsFactory()
throws IOException
IOExceptionpublic MongodForTestsFactory(IFeatureAwareVersion version) throws IOException
version - version of MongoDB.IOExceptionpublic static MongodForTestsFactory with(IFeatureAwareVersion version) throws IOException
IOExceptionprotected MongodConfig newMongodConfig(IFeatureAwareVersion version) throws IOException
IOExceptionpublic com.mongodb.MongoClient newMongo()
throws UnknownHostException
UnknownHostException@Deprecated public com.mongodb.DB newDB(com.mongodb.Mongo mongo)
public com.mongodb.client.MongoDatabase newDatabase(com.mongodb.MongoClient mongo)
public void shutdown()
Copyright © 2021. All rights reserved.