Pub/Sub integration tests
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Demonstrates how to integration test a function triggered by Pub/Sub.
Code sample
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["This document provides instructions and code examples for integration testing functions triggered by Pub/Sub events in Java, Node.js, PHP, and Python."],["The examples utilize the Functions Framework to run and test functions locally, ensuring they behave as expected when deployed."],["Each code sample showcases how to simulate a Pub/Sub message via an HTTP request to the locally running function, and verifies that the function correctly processes the message."],["The code uses methods to set up and tear down the local testing environment, and utilize libraries such as `resilience4j` for Java, `wait-port` for Node.js, `Symfony` for PHP, and `requests` for Python, to handle retries, server processes and other tasks."],["Instructions on setting up Application Default Credentials for authenticating to Cloud Run functions are provided, along with links to further documentation."]]],[]]