我通过记录服务器的事务创建了我的映射。现在我想使用我的 json 映射文件来加载映射。为此,我有以下代码:
import com.github.tomakehurst.wiremock.WireMockServer;
public class mockedTests{
public static WireMockServer mockingServer;
public void loadMaps(){
mockingServer.loadMappingsUsing(****);
}
}
我检查了wiremock代码,该loadMappingsUsing
方法需要aMappingsLoader
作为其参数。但是,我找不到MappingsLoader
正确创建的方法。我在文档中找不到任何内容,也找不到任何在线示例或教程。此外,我坚持使用WireMockServer
对象而不是规则或WireMock
对象。有谁知道我如何创建一个MappingsLoader
来加载我的映射 json 文件?我正在使用独立版本的wiremock。谢谢。