'When a connection is made the cluster status is sent to the new client.'

@capture_logging(assertHasAction, AGENT_CONNECTED, succeeded=True)
def test_connection_made_send_cluster_status(self, logger):

    sent = []
    self.patch_call_remote(sent, self.protocol)
    self.control_amp_service.configuration_service.save(_TEST_DEPLOYMENT)
    self.control_amp_service.cluster_state.apply_changes([NODE_STATE])
    self.protocol.makeConnection(StringTransportWithAbort())
    self.reactor.advance((CONTROL_SERVICE_BATCHING_DELAY * 2))
    cluster_state = self.control_amp_service.cluster_state.as_deployment()
    self.assertEqual(sent[0], ((ClusterStatusCommand,), dict(configuration=_TEST_DEPLOYMENT, configuration_generation=make_generation_hash(_TEST_DEPLOYMENT), state=cluster_state, state_generation=make_generation_hash(cluster_state))))
