我正在尝试使用spring-cloud-contract解决方案为HATEOAS服务提供合同。然而,我使用了HATEOAS资源的链接,因为您可以在任何随机端口上运行存根服务器,问题是如何包含由协定响应返回的绝对链接,然后由消费者使用??
有没有办法将当前的存根服务器端口注入到映射中?
非常感谢你提前
发布于 2018-03-12 22:46:40
在HATEOAS中使用contract的最佳解决方案是使用sample解决方案(您可以查看Oliver的RestBucks samplehttps://github.com/olivergierke/spring-restbucks#documentation--client-stub-generation的restdocs分支)。我们仍在努力找出最好的用户体验,所以任何反馈都是非常受欢迎的。
至于Is there any way to inject current stub server port into mapping?,嗯,我并没有真正想到什么。我想你必须硬编码端口。
https://stackoverflow.com/questions/49237753
复制相似问题