Slackbot
12/01/2023, 10:20 AMVictor Baulac
12/01/2023, 10:21 AMVictor Baulac
12/01/2023, 10:24 AMVictor Baulac
12/01/2023, 10:30 AMVictor Baulac
12/01/2023, 11:26 AMTom
12/01/2023, 11:28 AMVictor Baulac
12/01/2023, 11:29 AMVictor Baulac
12/01/2023, 11:30 AM{
"request": {
"method": "GET",
"urlPathPattern": "/myprolink/adc/golden/.*"
},
"response": {
"status": 200,
"bodyFileName": "goldens/C0402.png",
"transformers": ["response-template"],
"headers": {
"Content-Type": "image/png"
}
}
}
Victor Baulac
12/01/2023, 11:31 AMHTTP ERROR 500 java.io.FileNotFoundException: /home/wiremock/./__files/goldens/C0402.png (No such file or directory)
Victor Baulac
12/01/2023, 11:31 AMTom
12/01/2023, 11:32 AMTom
12/01/2023, 11:33 AMVictor Baulac
12/01/2023, 11:34 AMVictor Baulac
12/01/2023, 12:03 PMdocker run -it --rm -p 8080:8080 --name wiremock -v #YOURLOCALFOLDER#:/home/wiremock wiremock/wiremock:3.3.1
In your mapping directory, use this simple JSON (also attached)
{
"request": {
"method": "GET",
"urlPathPattern": "/my/path/ok"
},
"response": {
"status": 200,
"bodyFileName": "C0603.png",
"transformers": ["response-template"],
"headers": {
"Content-Type": "image/png"
}
}
}
And the image must be in your __files folder, but I'm sure you know that.
Try to access localhost:8080/my/path/ok --> very weird exception.
Remove the transformers from the JSON, try to access the same path (after reload of docker of course) --> image is displayedVictor Baulac
12/01/2023, 12:06 PMVictor Baulac
12/01/2023, 12:07 PMVictor Baulac
12/01/2023, 12:40 PMVictor Baulac
12/04/2023, 8:12 AMTom
12/04/2023, 9:32 AM"disableBodyFileTemplating": true
as a transformer parameter on the stub, which will just prevent templating on the body file itself.Victor Baulac
12/04/2023, 9:39 AMVictor Baulac
12/04/2023, 9:44 AM