def METHOD_NAME(self, exception, retries):
    doc = {'_id': uuid.uuid4().hex, 'doc_type': 'MyCoolDoc', 'property': 'bar'}
    with mock.patch("pillowtop.processors.elastic._propagate_failure", return_value=False), \
         mock.patch("pillowtop.processors.elastic._retries", return_value=retries), \
         mock.patch("pillowtop.processors.elastic._sleep_between_retries"), \
         mock.patch.object(self.adapter, 'index') as doc_adapter, \
         capture_log_output("pillowtop") as log:
        doc_adapter.side_effect = exception
        send_to_elasticsearch(self.adapter, doc['_id'], name='test', data=doc)
    return log.get_output()