MongoUtil { public Future<Void> init(boolean reset) { if (!reset) { return Future.succeededFuture(); } return cli.dropCollection(collection); } MongoUtil(String collection, MongoClient cli); Future<Boolean> delete(String id); Future<Void> init(boolean reset); Future<Void> add(T env, String id); Future<Void> insert(T md, String id); Future<List<T>> getAll(Class<T> clazz); void encode(JsonObject j, String id); void decode(JsonObject j);  }
@Test public void testInit(TestContext context) { MongoClient cli = new FakeMongoClient(); MongoUtil<String> util = new MongoUtil<>("collection", cli); util.init(true).onComplete(res -> { context.assertTrue(res.failed()); context.assertEquals("dropCollection failed", res.cause().getMessage()); }); }