我正在尝试使用WireMockRule模拟对远程主机的请求,但我被卡住了。目前我正在模拟对本地主机的请求,如下所示:
@Rule
public WireMockRule wireMockRule = new WireMockRule(80);
...
wireMockRule.stubFor(post(urlPathEqualTo("/api/users"))
.willReturn(aResponse()
.withStatus(200)));
这些适用于本地主机。但是,当我尝试类比
@Rule
public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().bindAddress("remote").port(80));
它不起作用,事件测试没有开始。所以我想问你们,也许有人会知道我做错了什么?谢谢