SpringCloud 消费者
在使用者方面,通过@AutoConfigureStubRunner批注,JUnit规则,JUnit 5扩展名或属性传递repositoryRoot参数时,足以传递带有协议前缀的SCM存储库的URL。例如
@AutoConfigureStubRunner(
stubsMode="REMOTE",
repositoryRoot="git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git",
ids="com.example:bookstore:0.0.1.RELEASE"
)通过这样的设置:
- Git项目将被克隆到一个临时目录
- SCM存根下载器将转到
META-INF/groupId/artifactId/version/文件夹以查找存根定义和合同。例如,对于com.example:foo:1.0.0,路径为META-INF/com.example/foo/1.0.0/ - 存根服务器将启动并提供映射
- 将在消息传递测试中读取和使用消息传递定义