小编mon*_*nty的帖子

使用 WireMock 时查询参数未匹配

我正在尝试使用以下存根点击 WireMock,但查询参数似乎没有匹配。这是回应:

                                               Request was not matched
                                               =======================

-----------------------------------------------------------------------------------------------------------------------
| Closest stub                                             | Request                                                  |
-----------------------------------------------------------------------------------------------------------------------
                                                           |
GET                                                        | GET
/mpp-pricing/v1/agreements\?accountId=.*                   | /mpp-pricing/v1/agreements?accountId=5388afaf-ee3d-44ed-a<<<<< URL does not match. When using a regex, "?" should be "\\?"
                                                           | b2a-0035156bb0a2
                                                           |

Run Code Online (Sandbox Code Playgroud)

这是我使用的存根:

{
  "request": {
    "method": "GET",
    "urlPathPattern": "/mpp-pricing/v1/agreements\\?accountId=.*"
  },
Run Code Online (Sandbox Code Playgroud)

http-request-parameters wiremock wiremock-standalone

5
推荐指数
1
解决办法
1万
查看次数