Spring Cloud Contract & Test Container

huangapple go评论50阅读模式
英文:

Spring Cloud Contract & Test Container

问题

我正在使用Spring Cloud Contract,现在我正在为事件驱动微服务创建集成测试。

我可以将Spring Cloud Contract(消息传递)与在TestContainer上运行的Kafka容器结合使用吗?我当然想要使用StubTrigger,但它也应该从我的Kafka主题中获取消息。有什么建议吗?这是否有意义?我认为我正在混合概念。

英文:

I am using Spring Cloud Contract, now I am making an integration test for event driven microservices.

Can i combine both Spring Cloud Contract (messaging) with Kafka container running on TestContainer? I want to use the StubTrigger of course but it should fetch the message also from my Kafka topic. Any suggestion? Does it even make sense? I think i am mixing the concepts.

答案1

得分: 3

你可以。你可以在这里查看有关Kafka和testcontainers的示例:https://github.com/spring-cloud-samples/spring-cloud-contract-samples/tree/main/consumer_kafka_middleware 和 https://github.com/spring-cloud-samples/spring-cloud-contract-samples/tree/main/producer_kafka_middleware

英文:

Yes you can. You can check out the examples with kafka and testcontainers here https://github.com/spring-cloud-samples/spring-cloud-contract-samples/tree/main/consumer_kafka_middleware and here https://github.com/spring-cloud-samples/spring-cloud-contract-samples/tree/main/producer_kafka_middleware

huangapple
  • 本文由 发表于 2023年2月14日 04:46:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75441011.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定