
Answer-first summary for fast verification
Answer: Create a service to publish messages, and deploy the Pub/Sub emulator. Publish a standard set of testing messages from the publishing service to the emulator.
The correct approach involves using the Pub/Sub emulator for testing without involving production data, ensuring security and reliability. Option D is the best choice as it suggests deploying the Pub/Sub emulator and publishing a standard set of testing messages. This method allows for controlled and repeatable tests, unlike options B and C which involve using production data, posing security risks. Option A's suggestion to generate random content is less reliable for thorough testing compared to a predefined set of test messages.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you test the Pub/Sub integration for an application that reads credit card data before deploying it to Google Cloud, after completing unit testing?
A
Create a service to publish messages, and deploy the Pub/Sub emulator. Generate random content in the publishing service, and publish to the emulator.
B
Create a service to publish messages to your application. Collect the messages from Pub/Sub in production, and replay them through the publishing service.
C
Create a service to publish messages, and deploy the Pub/Sub emulator. Collect the messages from Pub/Sub in production, and publish them to the emulator.
D
Create a service to publish messages, and deploy the Pub/Sub emulator. Publish a standard set of testing messages from the publishing service to the emulator.
No comments yet.