As discussed in  https://github.com/apache/airflow/pull/15534#discussion_r620500075, we could possibly rewrite Beam Hook to remove the need of storing state in it.
self, mock_dataflow_wait_for_done, mock_uuid
    ):
        self.dataflow_hook.beam_hook = BeamHook(runner="DataflowRunner")
        mock_uuid.return_value = MOCK_UUID
        on_new_job_id_callback = MagicMock()
        with pytest.raises(AirflowException, match=r"Invalid method invocation\."):
            with pytest.warns(DeprecationWarning, match="This method is deprecated"):
                self.dataflow_hook.start_python_dataflow(
                    job_name=JOB_NAME,
                    variables=DATAFLOW_VARIABLES_PY,
                    dataflow=PY_FILE,
                    py_options=PY_OPTIONS,
                    py_interpreter=DEFAULT_PY_INTERPRETER,
                    py_requirements=[],
                    on_new_job_id_callback=on_new_job_id_callback,
                )
        mock_dataflow_wait_for_done.assert_not_called()
    @mock.patch(DATAFLOW_STRING.format("uuid.uuid4"))
    @mock.patch(DATAFLOW_STRING.format("DataflowHook.wait_for_done"))
    @mock.patch(DATAFLOW_STRING.format("process_line_and_extract_dataflow_job_id_callback"))
    def test_start_java_dataflow(self, mock_callback_on_job_id, mock_dataflow_wait_for_done, mock_uuid):