Google Cloud Professional Cloud Developer — Question 100

You are developing an application that reads credit card data from a Pub/Sub subscription. You have written code and completed unit testing. You need to test the
Pub/Sub integration before deploying to Google Cloud. What should you do?

Answer options

Correct answer: D

Explanation

The correct answer is D because it allows for controlled testing by using a standard set of messages, ensuring that the integration works as intended with the emulator. Options A and C lack the focus on predefined messages, which are crucial for consistent testing, while option B involves production messages that could lead to unintended consequences in a live environment.