我从这个例子中得到了以下两行:https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-provider
consumer.setPactFile(new File("target/pacts/ping_client-ping_service.json"));
testConsumerPact = (Pact) PactReader.loadPact(consumer.getPactFile());
它们会产生以下消息:
The method getPactFile() from the type ConsumerInfo is deprecated
用什么代替?
感谢您提前提供的帮助。
最佳答案
如果您希望使用 JUnit 验证 PACT 作为提供者,您可以按照此操作:
https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-provider-junit
关于java - ConsumerInfo 类型中的 getPactFile() 方法已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45302163/