def METHOD_NAME(self):
    config = {
        "endpoints": {"https://app.datadoghq.com": ["foo"]},
        "proxy_settings": {
            "host": "localhost",
            "port": PROXY_PORT,
            "user": None,
            "password": None
        }
    }
    app = Application()
    app.skip_ssl_validation = True
    app._agentConfig = config
    trManager = TransactionManager(MAX_WAIT_FOR_REPLAY, MAX_QUEUE_SIZE, THROTTLING_DELAY)
    trManager._flush_without_ioloop = True  # Use blocking API to emulate tornado ioloop
    CustomAgentTransaction.set_tr_manager(trManager)
    app.use_simple_http_client = False # We need proxy capabilities
    app.agent_dns_caching = False
    # _test is the instance of this class. It is needed to call the method stop() and deal with the asynchronous
    # calls as described here : http://www.tornadoweb.org/en/stable/testing.html
    CustomAgentTransaction._test = self
    CustomAgentTransaction.set_application(app)
    CustomAgentTransaction.set_endpoints(config['endpoints'])
    CustomAgentTransaction('body', {}, "") # Create and flush the transaction
    self.wait(timeout=30)
    del CustomAgentTransaction._test
    access_log = self.docker_client.exec_start(
        self.docker_client.exec_create(CONTAINER_NAME, 'cat /var/log/squid/access.log')['Id'])
    self.assertTrue("CONNECT" in access_log) # There should be an entry in the proxy access log
    self.assertEquals(len(trManager._endpoints_errors), 1) # There should be an error since we gave a bogus api_key