Google Cloud Professional Cloud Developer — Question 253

You have a web application that publishes messages to Pub/Sub. You plan to build new versions of the application locally and want to quickly test Pub/Sub integration for each new build. How should you configure local testing?

Answer options

Correct answer: B

Explanation

The correct answer is B because it specifies using the Pub/Sub emulator, which allows for accurate local testing without interacting with the live service. Options A and C suggest calling the live Pub/Sub service, which is not suitable for local testing. Option D is incorrect because it lacks the necessary command to initialize the emulator properly.