【发布时间】:2020-02-05 22:21:47
【问题描述】:
我正在尝试使用 pact for jvm/spring 将验证结果发布到 pact 代理。 我正在使用junit4。 测试执行并通过,验证报告打印到控制台/添加json文件,但没有将结果发布到pact broker。
在 pom.xml 中:
<dependency>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-provider-spring_2.12</artifactId>
<version>3.5.24</version>
</dependency>
在 TestContract.class 中:
@RunWith(SpringRestPactRunner.class)
@Provider("prov_test")
@PactBroker(host="192.168.132.220",port="80")
@VerificationReports({"console", "json"})
@SpringBootTest(
properties={
"pact.provider.version=1.0.1",
"pact.verifier.publishResults=true"
},
webEnvironment = SpringBootTest.webEnvironment.DEFINED_PORT
)
public class TestContract {
...
...
}
在输出中我收到警告:
Skipping publishing of verification results (pact.verifier.publishResults is not set to 'true')
感谢您的帮助!
【问题讨论】:
标签: spring spring-boot pact