@mock.patch('airflow.providers.google.cloud.operators.bigquery.hashlib.md5')
@mock.patch('airflow.providers.google.cloud.operators.bigquery.BigQueryHook')
def test_execute_success(self, mock_hook, mock_md5):
    job_id = '123456'
    hash_ = 'hash'
    real_job_id = f'{job_id}_{hash_}'
    mock_md5.return_value.hexdigest.return_value = hash_
    configuration = {'query': {'query': 'SELECT * FROM any', 'useLegacySql': False}}
    mock_hook.return_value.insert_job.return_value = MagicMock(job_id=real_job_id, error_result=False)
    op = BigQueryInsertJobOperator(task_id='insert_query_job', configuration=configuration, location=TEST_DATASET_LOCATION, job_id=job_id, project_id=TEST_GCP_PROJECT_ID)
    result = op.execute({})
    mock_hook.return_value.insert_job.assert_called_once_with(configuration=configuration, location=TEST_DATASET_LOCATION, job_id=real_job_id, project_id=TEST_GCP_PROJECT_ID)
    assert (result == real_job_id)
@mock.patch('airflow.providers.google.cloud.operators.bigquery.hashlib.md5')
@mock.patch('airflow.providers.google.cloud.operators.bigquery.BigQueryHook')
def test_execute_success(self, mock_hook, mock_md5):
    job_id = '123456'
    hash_ = 'hash'
    real_job_id = f'{job_id}_{hash_}'
    mock_md5.return_value.hexdigest.return_value = hash_
    configuration = {'query': {'query': 'SELECT * FROM any', 'useLegacySql': False}}
    mock_hook.return_value.insert_job.return_value = MagicMock(job_id=real_job_id, error_result=False)
    op = BigQueryInsertJobOperator(task_id='insert_query_job', configuration=configuration, location=TEST_DATASET_LOCATION, job_id=job_id, project_id=TEST_GCP_PROJECT_ID)
    result = op.execute({})
    mock_hook.return_value.insert_job.assert_called_once_with(configuration=configuration, location=TEST_DATASET_LOCATION, job_id=real_job_id, project_id=TEST_GCP_PROJECT_ID)
    assert (result == real_job_id)