use of com.couchbase.client.core.deps.io.netty.channel.ChannelFutureListener in project couchbase-jvm-clients by couchbase.
the class KeyValueChannelIntegrationTest method assertAuthenticationFailure.
/**
* Helper method to assert authentication failure in different scenarios.
*/
private void assertAuthenticationFailure(final Bootstrap bootstrap, final String msg) throws Exception {
CountDownLatch latch = new CountDownLatch(1);
bootstrap.connect().addListener((ChannelFutureListener) future -> {
try {
assertFalse(future.isSuccess());
Throwable ex = future.cause();
assertTrue(ex instanceof AuthenticationFailureException);
assertEquals(msg, ex.getMessage());
} finally {
latch.countDown();
}
});
latch.await();
}
Aggregations