Java Wiiremock http失败错误
我为Jmeter中的HTTP负载测试请求编写了以下wiremock代码:Java Wiiremock http失败错误,java,load-testing,wiremock,Java,Load Testing,Wiremock,我为Jmeter中的HTTP负载测试请求编写了以下wiremock代码: 您指定了两个不同的端口号8081和8080 wiremock将仅在指定端口上运行,以下代码在本地主机上运行:8080/abc/xyz package com.wiremock; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.WireMock; import co
您指定了两个不同的端口号8081和8080
wiremock将仅在指定端口上运行,以下代码在本地主机上运行:8080/abc/xyz
package com.wiremock;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
import
com.github.tomakehurst.wiremock.stubbing.StubMapping;
import static
com.github.tomakehurst.wiremock.client.WireMock.*;
public class WireMockMain {
public static void main(String[] args) {
// TODO Auto-generated method stub
WireMockServer wireMockServer = new WireMockServer(8080);
//configureFor("localhost", 8081);
wireMockServer.start();
StubMapping foo = WireMock.stubFor(get(urlPathEqualTo("/abc/xyz"))
.willReturn(aResponse()
.withStatus(200)
.withBody("{\"message\": \"Hello World\"}")));
wireMockServer.addStubMapping(foo);
}
}
您指定了两个不同的端口号8081、8080 wiremock将仅在指定端口上运行,以下代码在本地主机上运行:8080/abc/xyz
package com.wiremock;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
import
com.github.tomakehurst.wiremock.stubbing.StubMapping;
import static
com.github.tomakehurst.wiremock.client.WireMock.*;
public class WireMockMain {
public static void main(String[] args) {
// TODO Auto-generated method stub
WireMockServer wireMockServer = new WireMockServer(8080);
//configureFor("localhost", 8081);
wireMockServer.start();
StubMapping foo = WireMock.stubFor(get(urlPathEqualTo("/abc/xyz"))
.willReturn(aResponse()
.withStatus(200)
.withBody("{\"message\": \"Hello World\"}")));
wireMockServer.addStubMapping(foo);
}
}
还有问题吗?什么代码?…还有问题吗?什么代码?。。。。。