Cleanup Pub/Sub functions to create test *Connection classes #7438
Labels
api: storage
Issues related to the Cloud Storage API.
type: cleanup
An internal cleanup or hygiene concern.
To test the
*Connection
classes we have special functions inpubsub_internal::
that decorate a*Mock
stub and then create the*Connection
, for example:google-cloud-cpp/google/cloud/pubsub/publisher_connection.h
Lines 167 to 169 in 1e29dce
Their implementation can be quite involved:
google-cloud-cpp/google/cloud/pubsub/publisher_connection.cc
Lines 112 to 147 in 1e29dce
Unfortunately, this breaks down with the introduction of the
*Auth
decorators, where the channel is created by theGrpcAuthenticationStrategy
, then we create the default*Stub
and then we wrap said stub with the*Auth
decorator and we need to preserve theBackgroundThreads
object to be owned by the connection.We should reorganize, and maybe rename, these functions to reflect the new structure.
The text was updated successfully, but these errors were encountered: