DeploymentManager { Future<Void> undeploy(String id) { logger.info("undeploy instId {}", id); if (!list.containsKey(id)) { return Future.failedFuture(new OkapiError(ErrorType.NOT_FOUND, messages.getMessage("10705", id))); } DeploymentDescriptor md = list.get(id); return dm.remove(md.getSrvcId(), md.getInstId()).compose(res -> { ModuleHandle mh = md.getModuleHandle(); return mh.stop().compose(x -> { list.remove(id); return Future.succeededFuture(); }); }).mapEmpty(); } DeploymentManager(Vertx vertx, DiscoveryManager dm, EnvManager em,
                           String host, int listenPort, String nodeName, JsonObject config); Future<Void> init(); Future<Void> shutdown();  }
@Test public void testUndeployNotFound(TestContext context) { createDeploymentManager(context); Async async = context.async(); LaunchDescriptor descriptor = new LaunchDescriptor(); dm.undeploy("1234").onComplete(res -> { context.assertFalse(res.succeeded()); context.assertEquals("not found: 1234", res.cause().getMessage()); async.complete(); }); async.await(); }