@Test
public void recoverOpenConnection() {

    new TestKit(actorSystem) {{
        final TestProbe mockClientProbe = TestProbe.apply(actorSystem);
        ActorRef underTest =
                TestConstants.createConnectionSupervisorActor(connectionId, actorSystem, pubSubMediator,
                        proxyActor,
                        (connection, concierge, connectionActor) -> MockClientActor.props(mockClientProbe.ref()));
        watch(underTest);
        // create connection
        underTest.tell(createConnection, getRef());
        expectMsg(createConnectionResponse);
        // wait for open connection of initial creation
        mockClientProbe.expectMsg(OpenConnection.of(connectionId, DittoHeaders.empty()));
        // stop actor
        getSystem().stop(underTest);
        expectTerminated(underTest);
        // recover actor
        final TestProbe recoveredMockClientProbe = TestProbe.apply(actorSystem);
        underTest = Retry.untilSuccess(
                () -> TestConstants.createConnectionSupervisorActor(connectionId, actorSystem, pubSubMediator,
                        proxyActor, (connection, concierge, connectionActor) -> MockClientActor.props(
                                recoveredMockClientProbe.ref())));
        // connection is opened after recovery -> recovered client actor receives OpenConnection command
        recoveredMockClientProbe.expectMsg(OpenConnection.of(connectionId, DittoHeaders.empty()));
        // poll connection status until status is OPEN
        final ActorRef recoveredActor = underTest;
        Awaitility.await().untilAsserted(() -> {
            recoveredActor.tell(retrieveConnectionStatus, getRef());
            expectMsg(retrieveConnectionStatusOpenResponse);
        });
    }};
}