@Test
public void testConnectionWithoutPublisherHandling() {

    new TestKit(actorSystem) {{
        final ConnectionId randomConnectionId = TestConstants.createRandomConnectionId();
        final Connection connectionWithoutTargets =
                TestConstants.createConnection(randomConnectionId, new Target[0]);
        final Props props =
                RabbitMQClientActor.propsForTests(connectionWithoutTargets, getRef(), getRef(),
                        (con, exHandler) -> mockConnectionFactory).withDispatcher(CallingThreadDispatcher.Id());
        final ActorRef rabbitClientActor = actorSystem.actorOf(props);
        watch(rabbitClientActor);
        rabbitClientActor.tell(OpenConnection.of(randomConnectionId, DittoHeaders.empty()), getRef());
        expectMsg(CONNECTED_SUCCESS);
        rabbitClientActor.tell(CloseConnection.of(randomConnectionId, DittoHeaders.empty()), getRef());
        expectMsg(DISCONNECTED_SUCCESS);
    }};
}