Skip to content

Commit

Permalink
fix assertions (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
b1ron committed Nov 21, 2023
1 parent 14a406c commit 9ff08cd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions java/src/main/java/com/start/Connection.java
Expand Up @@ -11,7 +11,6 @@
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.result.InsertManyResult;

public class Connection {

Expand All @@ -24,12 +23,12 @@ public static void main(String[] args) {
Document command = new Document("ping", 1);
Document res = database.runCommand(command);

assert res.equals(new Document("ok", 1.0)) : "ping failed";
assert res.getDouble("ok").equals(1.0) : "ping failed";

command = new Document("dropDatabase", 1);
res = database.runCommand(command);

assert res.equals(new Document("ok", 1.0)) : "dropDatabase failed";
assert res.getDouble("ok").equals(1.0) : "dropDatabase failed";

List<Document> docList = new ArrayList<Document>(4);
docList.add(new Document("_id", 1).append("a", 1));
Expand Down

0 comments on commit 9ff08cd

Please sign in to comment.