diff --git a/airflow/providers/salesforce/example_dags/__init__.py b/airflow/providers/salesforce/example_dags/__init__.py deleted file mode 100644 index 13a83393a9124..0000000000000 --- a/airflow/providers/salesforce/example_dags/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. diff --git a/docs/apache-airflow-providers-salesforce/operators/salesforce_apex_rest.rst b/docs/apache-airflow-providers-salesforce/operators/salesforce_apex_rest.rst index a699f5ace5b8b..00b4b4c643434 100644 --- a/docs/apache-airflow-providers-salesforce/operators/salesforce_apex_rest.rst +++ b/docs/apache-airflow-providers-salesforce/operators/salesforce_apex_rest.rst @@ -30,7 +30,7 @@ You can also use this library to call custom Apex methods: This would call the endpoint ``https://.salesforce.com/services/apexrest/User/Activity`` with ``payload`` as the body content encoded with ``json.dumps`` -.. exampleinclude:: /../../airflow/providers/salesforce/example_dags/example_salesforce_apex_rest.py +.. exampleinclude:: /../../tests/system/providers/salesforce/example_salesforce_apex_rest.py :language: python :start-after: [START howto_salesforce_apex_rest_operator] :end-before: [END howto_salesforce_apex_rest_operator] diff --git a/airflow/providers/salesforce/example_dags/example_salesforce_apex_rest.py b/tests/system/providers/salesforce/example_salesforce_apex_rest.py similarity index 84% rename from airflow/providers/salesforce/example_dags/example_salesforce_apex_rest.py rename to tests/system/providers/salesforce/example_salesforce_apex_rest.py index c8e5850efd94c..0053531e0753a 100644 --- a/airflow/providers/salesforce/example_dags/example_salesforce_apex_rest.py +++ b/tests/system/providers/salesforce/example_salesforce_apex_rest.py @@ -14,11 +14,16 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +import os from datetime import datetime from airflow import DAG from airflow.providers.salesforce.operators.salesforce_apex_rest import SalesforceApexRestOperator +ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID") +DAG_ID = "example_gcs_to_trino" + + with DAG( dag_id="salesforce_apex_rest_operator_dag", schedule_interval=None, @@ -33,3 +38,9 @@ task_id="apex_task", method='POST', endpoint='User/Activity', payload=payload ) # [END howto_salesforce_apex_rest_operator] + + +from tests.system.utils import get_test_run # noqa: E402 + +# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest) +test_run = get_test_run(dag)