def METHOD_NAME(mocker):
    """Return a connection mocker fixture"""
    from kafka.METHOD_NAME import ConnectionStates
    from kafka.future import Future
    from kafka.protocol.metadata import MetadataResponse
    METHOD_NAME = mocker.patch('kafka.client_async.BrokerConnection')
    METHOD_NAME.return_value = METHOD_NAME
    METHOD_NAME.state = ConnectionStates.CONNECTED
    METHOD_NAME.send.return_value = Future().success(
        MetadataResponse[0](
            [(0, 'foo', 12), (1, 'bar', 34)],  # brokers
            []))  # topics
    METHOD_NAME.blacked_out.return_value = False
    def _set_conn_state(state):
        METHOD_NAME.state = state
        return state
    METHOD_NAME._set_conn_state = _set_conn_state
    METHOD_NAME.connect.side_effect = lambda: METHOD_NAME.state
    METHOD_NAME.connect_blocking.return_value = True
    METHOD_NAME.connecting = lambda: METHOD_NAME.state in (ConnectionStates.CONNECTING,
                                             ConnectionStates.HANDSHAKE)
    METHOD_NAME.connected = lambda: METHOD_NAME.state is ConnectionStates.CONNECTED
    METHOD_NAME.disconnected = lambda: METHOD_NAME.state is ConnectionStates.DISCONNECTED
    return METHOD_NAME