【问题标题】:How to test application integration with Google Cloud Storage? [closed]如何测试应用程序与 Google Cloud Storage 的集成? [关闭]
【发布时间】:2021-03-22 16:23:27
【问题描述】:

我有一个与 Google Cloud Storage 集成的应用程序。我需要编写一些单元/集成测试来使用 Google Cloud Storage 测试我的应用程序。

我找到了一个模拟凭据提供程序的 Java 的 MockGoogleCredential 类,但我找不到任何代码示例。有人用过吗?

【问题讨论】:

  • 您使用哪个框架进行测试?你通常如何模拟一堂课?用什么?

标签: java testing google-cloud-platform mocking google-cloud-storage


【解决方案1】:

here 解释的 gsutil test 命令可用于运行 gsutil 单元测试和集成测试。单元测试使用内存中的模拟存储服务实现,而集成测试使用 boto 配置文件中设置的首选 API 将请求发送到生产服务,请查看 gsutil help apis 了解更多详细信息。

此外,我遇到了Google In-Memory emulator,但根据 Stackoverflow 的一些帖子,这已移至here

还开发了一些非官方选项,例如 this one,您可以使用它来存根/模拟 Google Cloud Storage 作为独立服务器。

最后,在浏览相关的 GitHub Feature Requests 时,我遇到了 this 非官方库,其中包括集成测试并支持 GCS,根据 this GitHub 问题。

【讨论】:

    猜你喜欢
    • 2012-03-29
    • 2020-07-09
    • 1970-01-01
    • 1970-01-01
    • 2021-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多