The unit tests provided are somewhat limited. Due to the nature of the component, it needs to be tested against a server. To assist with this task Google has provided a PubSub Emulator. The test for the component, therefore, have been split into two groups :
Emulator is being distributed with the Google SDK. Once the SDK has been installed and configured, add PubSub Emulator:
gcloud components install pubsub-emulator
Please note the folder where it is installed and configure GCLOUD_SDK_PATH environmental variable. It is a custom variable, used by mvn plugin to find the installation.
Maven is configured to start the emulator prior the integration tests and shut down afterwards. The emulator is configured to listen to port 8383.
Integration tests and the emulator will eb available as part of google-pubsub-test profile:
mvn -Pgoogle-pubsub-test verify