the documentation of wiremock says that we can mock a a request that retrieve a file thanks to this code :
{
"request": {
"method": "GET",
"url": "/body-file"
},
"response": {
"status": 200,
"bodyFileName": "path/to/myfile.xml"
}
}
But now I have to find a way to reaaly upload the file other wise I have 500 error on the request.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /body-file. Reason:
<pre> java.lang.RuntimeException: java.io.FileNotFoundException: /wiremock-standalone/./__files/path/to/myfile.xml (No such file or directory)</pre>
</p>
<hr />
<i>
<small>Powered by Jetty://</small>
</i>
</body>
Precision : I cannot upload the file directly due to our infrastructure constraints.