Albert Vesker
05/26/2023, 9:51 AM{
"errors": [
{
"code": 10,
"source": {
"pointer": "/mappings"
},
"title": "Error parsing JSON",
"detail": "Unrecognized field \"mappings\" (class com.github.tomakehurst.wiremock.stubbing.StubMapping), not marked as ignorable"
}
]
}
version: 2.34.0Tom
05/26/2023, 10:16 AMAlbert Vesker
05/26/2023, 10:23 AM{
"mappings": [
{
"scenarioName": "payment-status-11192",
"requiredScenarioState": "payment-status-created",
"request": {
"url": "/api/v2/payment",
"method": "GET"
},
"response": {
"status": 200,
"jsonBody": [
{
"orderNumber": "00011192"
}
],
"headers": {
"Content-Type": "application/json"
}
}
},
{
"scenarioName": "payment-status-11192",
"requiredScenarioState": "payment-status-complete",
"request": {
"url": "/api/v2/payment",
"method": "GET"
},
"response": {
"status": 200,
"jsonBody": [
{
"orderNumber": "11111192"
}
],
"headers": {
"Content-Type": "application/json"
}
}
}
]
}
Tom
05/26/2023, 10:26 AMAlbert Vesker
05/26/2023, 10:30 AMTom
05/26/2023, 10:31 AMWireMock.importStubMappings(Json.read("{your JSON}", StubImport.class));
loadMappingsFrom
takes a folder path as the parameter - was that what you were passing?Albert Vesker
05/26/2023, 10:34 AMtakes a folder path as the parameter - was that what you were passing?Yes. It works for every mapping except my example
Tom
05/26/2023, 10:37 AMloadMappingsFrom
still only supports the single file format so you’ll need to use the import variantAlbert Vesker
05/26/2023, 10:39 AMTom
05/26/2023, 10:39 AMAlbert Vesker
05/26/2023, 10:41 AMTom
05/26/2023, 10:47 AMAlbert Vesker
05/26/2023, 10:49 AMWireMock.importStubMappings(Json.read("{your JSON}", StubImport.class));
Am I right?Tom
05/26/2023, 10:50 AMAlbert Vesker
05/26/2023, 10:51 AM{ "mappings": [] }
variant
It will take a lot of time and as we understood this class doesn't have backward capability
What can u say about this situation?Tom
05/30/2023, 1:31 PMRemoteMappingsLoader
supports multi-mapping files, then you can switch to using them.Albert Vesker
05/30/2023, 1:34 PMTom
05/30/2023, 1:36 PMAlbert Vesker
05/30/2023, 1:40 PMTom
05/30/2023, 5:45 PM