Cloud Storage 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 Cloud Storage.
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 examples of how to perform integration testing on functions triggered by Cloud Storage events in Java, Node.js, PHP, and Python."],["The code samples demonstrate how to set up a local testing environment using the Functions Framework Maven plugin or the `functions-framework` CLI tool, running the function locally and sending requests."],["Authentication to Cloud Run functions requires setting up Application Default Credentials, and more information is available in the linked documentation."],["The tests verify that the function correctly processes simulated Cloud Storage events by sending HTTP requests with formatted JSON payloads and asserting expected outputs."],["Resilience4j library is utilized in the Java example to retry the HTTP requests until the plugin responds, helping handle potential delays in the local setup."]]],[]]