use of io.zeebe.transport.ServerTransport in project zeebe by zeebe-io.
the class ZeebeClientTest method shouldCloseAllConnectionsOnClose.
@Test
public void shouldCloseAllConnectionsOnClose() throws Exception {
// given
final ServerTransport serverTransport = broker.getTransport();
final TopicSubscription subscription = openSubscription();
final LoggingChannelListener channelListener = new LoggingChannelListener();
serverTransport.registerChannelListener(channelListener).join();
// when
client.close();
// then
assertThat(subscription.isClosed()).isTrue();
// listener invocation on close is asynchronous
waitUntil(() -> channelListener.connectionState.size() == 1);
assertThat(channelListener.connectionState).containsExactly(ConnectionState.CLOSED);
}
Aggregations