use of com.couchbase.client.core.cnc.events.io.SecureConnectionFailedEvent in project couchbase-jvm-clients by couchbase.
the class TransportEncryptionIntegrationTest method failsIfWrongCertPresent.
@Test
@SuppressWarnings("unchecked")
void failsIfWrongCertPresent() {
SimpleEventBus eventBus = new SimpleEventBus(true);
CoreEnvironment env = secureEnvironment(SecurityConfig.enableTls(true).trustCertificates(mock(List.class)), eventBus);
Core core = Core.create(env, authenticator(), secureSeeds());
try {
core.openBucket(config().bucketname());
waitUntilCondition(() -> {
boolean hasEndpointConnectFailedEvent = false;
boolean hasSecureConnectionFailedEvent = false;
for (Event event : eventBus.publishedEvents()) {
if (event instanceof EndpointConnectionFailedEvent) {
hasEndpointConnectFailedEvent = true;
}
if (event instanceof SecureConnectionFailedEvent) {
hasSecureConnectionFailedEvent = true;
}
}
return hasEndpointConnectFailedEvent && hasSecureConnectionFailedEvent;
});
} finally {
core.shutdown().block();
env.shutdown();
}
}
Aggregations