 
     // Replace the ready expectation (since it's already been fulfilled).
     let reconnectionReady = self.expectation(description: "(re)connection ready")
-    self.stateDelegate.readyExpectation = reconnectionReady
+    self.stateDelegate.expectations[.ready] = reconnectionReady
 
     let echo = Echo_EchoServiceClient(connection: self.client)
     // This should succeed once we get a connection again.


    let connectionReady = self.expectation(description: "connection ready")
    let transientFailure = self.expectation(description: "connection transientFailure")
    self.stateDelegate.readyExpectation = connectionReady
    self.stateDelegate.transientFailureExpectation = transientFailure

    self.client = ClientConnection(configuration: configuration)


    configuration.connectionBackoff = nil

    let connectionShutdown = self.expectation(description: "client shutdown")
    self.stateDelegate.expectations[.shutdown] = connectionShutdown
    self.client = ClientConnection(configuration: configuration)

    self.wait(for: [connectionShutdown], timeout: 1.0)
