@Test
public void sendCommandDuringInit() {

    new TestKit(actorSystem) {{
        final CountDownLatch latch = new CountDownLatch(1);
        final Props props =
                AmqpClientActor.propsForTests(connection,
                        getRef(), getRef(), (ac, el) -> waitForLatchAndReturn(latch, mockConnection));
        final ActorRef amqpClientActor = actorSystem.actorOf(props);
        watch(amqpClientActor);
        amqpClientActor.tell(OpenConnection.of(CONNECTION_ID, DittoHeaders.empty()), getRef());
        latch.countDown();
        expectMsg(CONNECTED_SUCCESS);
    }};
}