Wiremock为一个存根网址返回404

tuk*_*tuk 13 java wiremock

我已经定义了wireMock服务器如下: -

    private WireMockServer wireMockServer;
        @Before
        public void preSetup() throws Exception {
          wireMockServer = new WireMockServer(56789);
          wireMockServer.start();
        };

        @Override
        @After
        public void tearDown() {
          wireMockServer.stop();
        }

        @Test
        public void testSendMatchingMessage() throws Exception {

          wireMockServer.stubFor(get(urlEqualTo("/orders/v1/ordersearch/"))
            .willReturn(aResponse().withStatus(200).withBody("<response>Some content</response>")));

       }

Run Code Online (Sandbox Code Playgroud)

但每当我点击下面的网址时

http://0.0.0.0:56789/orders/v1/ordersearch/?field=address%2Cfinance%2Cshipping&limit=10&page=2&q=createdFrom.gt%7E2016-01-11T10%3A12%3A13
Run Code Online (Sandbox Code Playgroud)

我收到以下错误: -

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
    <title>Error 404 NOT_FOUND</title>
    </head>
    <body><h2>HTTP ERROR 404</h2>
    <p>Problem accessing /__files/orders/v1/ordersearch/. Reason:
    <pre>    NOT_FOUND</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>                                                
    <br/>     
    </body>
    </html>
Run Code Online (Sandbox Code Playgroud)

有人可以让我知道我做错了什么吗?

iva*_*eev 21

根据Stubbing - Wiremock(谷歌中的第一个"wiremockserver urlequalto"):

注意:您必须使用urlPathEqualTourlPathMatching指定路径,urlEqualTo或者urlMatching将尝试匹配整个请求URL,包括查询参数.