use of de.flapdoodle.embed.mongo.config.MongodConfig in project zeppelin by apache.
the class MongoNotebookRepoTest method setUp.
@Before
public void setUp() throws IOException {
String bindIp = "localhost";
ServerSocket socket = new ServerSocket(0);
int port = socket.getLocalPort();
socket.close();
MongodConfig mongodConfig = MongodConfig.builder().version(Version.Main.PRODUCTION).net(new Net(bindIp, port, Network.localhostIsIPv6())).build();
mongodExecutable = MongodStarter.getDefaultInstance().prepare(mongodConfig);
mongodExecutable.start();
System.setProperty(ZEPPELIN_NOTEBOOK_MONGO_URI.getVarName(), "mongodb://" + bindIp + ":" + port);
zConf = ZeppelinConfiguration.create();
notebookRepo = new MongoNotebookRepo();
notebookRepo.init(zConf);
}
Aggregations