Hisham Huneidie
10/31/2023, 9:32 AM// mappings/MediaGallery/get-video-mapping.json
{
"request": {
"method": "GET",
"urlPathTemplate": "/wiremock/media/library/video/{videoId}"
},
"response": {
"status": 200,
"bodyFileName": "MediaGallery/media-video-with-id.json",
"headers": {
"Content-Type": "application/json"
}
}
}
And a body response file
// __files/MediaGallery/media-video-with-id.json
{
"one": ${videoId},
"two": "${videoId}",
"three": {videoId},
"four": {{videoId}},
"five": "{videoId}",
"six": "{{videoId}}",
"seven": $.videoId,
"eight": {$.videoId},
"nine": ${$.videoId},
"ten": {{request.pathSegments.[1]}},
}
The variable doesn’t get replaced. No one of these combinations work.
¿What is the form to write a variable in my body response file?
ThanksLee Turner
10/31/2023, 9:40 AMHisham Huneidie
10/31/2023, 9:41 AM3.2.0
Lee Turner
10/31/2023, 9:44 AM"transformers" : [ "response-template" ]
{
"request": {
"method": "GET",
"urlPathTemplate": "/wiremock/media/library/video/{videoId}"
},
"response": {
"status": 200,
"bodyFileName": "media-video-with-id.json",
"headers": {
"Content-Type": "application/json"
},
"transformers": [
"response-template"
]
}
}
Hisham Huneidie
10/31/2023, 9:46 AM{
"one": ${videoId},
"two": "${videoId}",
"three": {videoId},
"four": {{videoId}},
"five": "{videoId}",
"six": "{{videoId}}",
"seven": $.videoId,
"eight": {$.videoId},
"nine": ${$.videoId},
"ten": {{request.pathSegments.[1]}},
}
Lee Turner
10/31/2023, 9:53 AM"ten": "{{request.pathSegments.[4]}}"
Hisham Huneidie
10/31/2023, 9:54 AMLee Turner
10/31/2023, 9:55 AMTom
10/31/2023, 10:15 PM{{request.path.videoId}}
should also do the trickLee Turner
11/01/2023, 9:18 AMTom
11/01/2023, 9:27 AM