How to Test a Google Pub/Sub Subscriber
A Google Pub/Sub publish can succeed while the worker that processes it is falling behind. A unit test that calls your handler with one JSON object can check the business logic, but it skips the part where the worker has to nack a delivery, see it again, and acknowledge it with a fresh ack ID. This walkthrough uses the Go order worker in mock-lab’s gRPC lab.