WorkflowRpcService extends AbstractService { public InetSocketAddress getConnectAddress() { return NetUtils.getConnectAddress(server); } WorkflowRpcService(String name, Server server); Server getServer(); InetSocketAddress getConnectAddress();  }
@Test public void testLifecycle() throws Throwable { MockRPC rpc = new MockRPC(); WorkflowRpcService svc = new WorkflowRpcService("test", rpc); run(svc); assertTrue(rpc.started); svc.getConnectAddress(); svc.stop(); assertTrue(rpc.stopped); }