code: def test_deferred(self, mock_create_endpoint, _, __):
      self.sagemaker.deferrable = True
  
      mock_create_endpoint.return_value = {
          "ResponseMetadata": {"HTTPStatusCode": 200}
      }
  
      with pytest.raises(TaskDeferred) as defer:
          self.sagemaker.execute(None)
  
      assert isinstance(defer.value.trigger, SageMakerTrigger)
      assert defer.value.trigger.job_name == "endpoint_name"
      assert defer.value.trigger.job_type == "endpoint"
  
file_path: airflow/tests/providers/amazon/aws/operators/test_sagemaker_endpoint.py
imports: from __future__ import annotations
  from unittest import mock
  import pytest
  from botocore.exceptions import ClientError
  from airflow.exceptions import AirflowException, TaskDeferred
  from airflow.providers.amazon.aws.hooks.sagemaker import SageMakerHook
  from airflow.providers.amazon.aws.operators import sagemaker
  from airflow.providers.amazon.aws.operators.sagemaker import SageMakerEndpointOperator
  from airflow.providers.amazon.aws.triggers.sagemaker import SageMakerTrigger
label_desc: Use image node_id 7 for calling the TestSageMakerEndpointOperator obj's underlying member method code with example usage: obj.test_deferred(mock_create_endpoint, _, __) without return types