Skip to content
Snippets Groups Projects
Commit 5521996f authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman :boom:
Browse files

Updated dependencies to latest versions.

parent f8bbd8ce
No related branches found
No related tags found
No related merge requests found
......@@ -337,7 +337,7 @@
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<version>1.47.3</version>
<version>1.48.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
......@@ -348,7 +348,7 @@
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.13.0</version>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
......
......@@ -700,12 +700,7 @@ public class StartMongoMojo extends AbstractMongoMojo {
throw new MojoExecutionException("Database name is missing");
}
final MongoClient mongoClient;
try {
mongoClient = new MongoClient("localhost", getPort());
} catch (final UnknownHostException e) {
throw new MojoExecutionException("Unable to connect to mongo instance", e);
}
final MongoClient mongoClient = new MongoClient("localhost", getPort());
getLog().info("Connected to MongoDB");
return mongoClient.getDB(databaseName);
}
......
......@@ -16,6 +16,8 @@
*/
package com.mongodb;
import org.bson.BsonDocument;
import java.net.UnknownHostException;
import java.util.Set;
......@@ -26,44 +28,20 @@ public class EmbedMongoDB extends DB {
}
public CommandResult notOkErrorResult(String message) {
try {
CommandResult commandResult = new CommandResult(new ServerAddress("localhost"));
commandResult.put("errmsg", message);
commandResult.put("ok", 0);
return commandResult;
} catch (UnknownHostException e) {
return null;
}
CommandResult commandResult = new CommandResult(new BsonDocument(){}, new ServerAddress("localhost"));
commandResult.put("errmsg", message);
commandResult.put("ok", 0);
return commandResult;
}
@Override
public CommandResult doEval(String code, Object... args) {
CommandResult commandResult;
try {
commandResult = new CommandResult(new ServerAddress("localhost"));
commandResult.put("ok", 1.0);
commandResult.put("retval", "null");
} catch (UnknownHostException e) {
return notOkErrorResult(e.getMessage());
}
CommandResult commandResult = new CommandResult(new BsonDocument(){}, new ServerAddress("localhost"));
commandResult.put("ok", 1.0);
commandResult.put("retval", "null");
return commandResult;
}
@Override
public void requestStart() {
}
@Override
public void requestDone() {
}
@Override
public void requestEnsureConnection() {
}
@Override
protected DBCollection doGetCollection(String name) {
return null;
......@@ -73,14 +51,4 @@ public class EmbedMongoDB extends DB {
public Set<String> getCollectionNames() {
return null;
}
@Override
CommandResult doAuthenticate(MongoCredential credentials) {
return null;
}
@Override
public void cleanCursors(boolean force) {
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment