我有以下方法尝试连接到我的mongodb服务器
public MongoClient connectToDatabase(String env){
if(env.equals("PROD")){
mongoClient = new MongoClient(new MongoClientURI(prop.getProperty(Constants.PrimaryPROD)));
logger.info("Prod Connection established");
}
else{
mongoClient = new MongoClient(new MongoClientURI(prop.getProperty(Constants.PrimaryUAT)));
logger.info("UAT Connection established");
}
return mongoClient;
}
现在我想在Java中对此方法执行单元测试。怎么做?