我正在尝试在带有多个存根的maps文件夹下创建一个mapping.json,如下所示。但我面临以下错误
Wiremock:v2.5.1(独立)
Mapping.json文件外观,
[
{
"scenarioName": "Savings account Stub",
"request": {
"url": "/ws/*****",
"method": "POST",
"bodyPatterns" : [{
"contains" : "AccountRequest"
}
]
},
"response": {
"status": 200,
"bodyFileName": "******"
}
},
{
"scenarioName": "Current account Stub",
"request": {
"method": "POST",
"url": "/ws/*****",
"bodyPatterns": [
{
"contains": "AccountListRequest"
}
]
},
"response": {
"status": 200,
"bodyFileName": "******"
}
}]
错误:
Exception in thread "main" wiremock.com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.github.tomakehurst.wiremock.stubbing.StubMapping out of START_ARRAY token
是否有可能在单个映射文件中为同一URL创建多个存根?谁能告诉我确切的问题是什么?
[Looking at the stubbing documentation,我想您希望您的mappings.json
看起来像...
{
"mappings": [
{
"request": {},
"request": {}
}
]
}