You are planning to add unit tests to your application. You need to be able to assert that published Pub/Sub messages are processed by your subscriber in order. You want the unit tests to be cost-effective and reliable. What should you do?
A.
Implement a mocking framework.
B.
Create a topic and subscription for each tester.
Option B, creating a topic and subscription for each tester, would be costly and time-consuming as it would require creating and managing a large number of topics and subscriptions. Additionally, it would not ensure that messages are processed in order, as messages may be delivered out of order to different subscriptions.
Option D, using the Pub/Sub emulator, would be cost-effective and reliable as it allows you to test your application's Pub/Sub functionality locally without incurring any costs. Additionally, the emulator allows you to easily assert that messages are processed in order by using the same topic and subscription for all unit tests.
Agree with D. They want unit test cost-effective and reliable so need an emulator which will never have an issue to do that.
B is not correct for me because the unit test using a real topic and subscription can have issue sometimes and it's not cost-effective to pay for each tester a subscription. The b is more a solution for integration test.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
__rajan__
7 months, 1 week agoomermahgoub
1 year, 3 months agotelp
1 year, 3 months agoTNT87
1 year, 4 months agomicoams
1 year, 4 months agox_cath
1 year, 4 months agosharath25
1 year, 4 months agozellck
1 year, 4 months ago