@Test @SuppressWarnings("unchecked") public void testDestroy() throws Exception { Future<String> future = new SucceededFuture<String>(ImmediateEventExecutor.INSTANCE, "test"); when(eventLoopGroup.shutdownGracefully()).thenReturn((Future) future); jannelClient.destroy(); verify(eventLoopGroup).shutdownGracefully(); }
@Override public Future<?> closeAsync() { synchronized (meshyClients) { if (refCount.decrementAndGet() == 0) { meshyClients.remove(key); return super.closeAsync(); } else { return new SucceededFuture<>(GlobalEventExecutor.INSTANCE, null); } } }
@Override public Future<Boolean> shutdown() { return new SucceededFuture<>(GlobalEventExecutor.INSTANCE, true); }
@Override public Future<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit) { return new SucceededFuture<>(GlobalEventExecutor.INSTANCE, true); }