【问题标题】:Performing contract testing using Spring Cloud Contract against AWS API Gateway/Kinesis使用 Spring Cloud Contract 对 AWS API Gateway/Kinesis 执行合同测试
【发布时间】:2019-03-28 05:21:47
【问题描述】:

我想对向 Kinesis 提供事件的 REST API(使用 AWS API Gateway)执行合同测试。我一直在寻找 Spring Cloud Contract 来执行这种类型的合同测试。但是,我在网上找不到任何使用 Spring Cloud Contract 来执行这种类型的测试(在 Kinesis 的情况下作为 Spring Cloud Contract 服务器/生产者)的东西。这是否可能和/或使用 Spring Cloud Contract 是否有意义?我应该使用其他工具对 AWS API Gateway/Kinesis 执行合同测试吗?

【问题讨论】:

    标签: aws-api-gateway amazon-kinesis spring-cloud-contract


    【解决方案1】:

    这是一个很好的问题。是的,您可以通过与 WireMock 的集成来执行它。由于您不拥有该应用程序的 api,因此您不能强迫他们创建合同定义和存根等。但是,您可以做的是设置将调用 aws 网关的真实 api 的测试,并将以wiremock存根的形式记录这对请求/回复。在这里,您可以找到这样一个示例,用于删除名为 Stripe https://github.com/spring-cloud-samples/the-legacy-app/tree/master/stubs_with_proxy 的公司的 api

    【讨论】:

    • 对于此处的任何混淆和不清楚的地方,我深表歉意。然而,我实际上将是创建应用程序 API 并处理 API 请求处理的人(即不是 API 网关的客户端)。在 Spring Cloud Contract 中,这意味着我将成为生产者。在这种情况下,API 将使用 AWS API Gateway 提供服务。 AWS API Gateway 将作为将事件传递给 Kinesis 的代理。希望这能解决我的问题 - 考虑到 AWS API Gateway 和 Kinesis 的使用,我希望你能在 Spring Cloud Contract 生产者方面得到测试的答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    • 1970-01-01
    • 1970-01-01
    • 2018-10-08
    • 2021-06-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多