简体   繁体   中英

Spring Cloud Contract - Node.js as producer

My team is creating 2 microservices. One in Spring - consumer and another in Node.js - producer. They will communicate through http rest api.

We would like to test them using contract. I've seen https://spring.io/blog/2018/02/13/spring-cloud-contract-in-a-polyglot-world but it's a different case (producer is on Java side and consumer is on Js).

Is there a way to define contract and generate tests for both microservices in such case?

You can generate a standard contract test with the spring cloud contract plugin. You will also generate stubs and push them out. On the consumer side you can use the docker spring cloud stub runner image to run the stubs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM