Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mocking Http Server responses using WireMock. FileNotFoundException

Just started using wiremock and come across a scenario where i want to stub a GET request with a specific json response.

When appending the json to the expected response with;

.withBodyFile("product.json"))

I get the exception java.io.FileNotFoundException: src/test/resources/__files/product.json (No such file or directory).

The thing is I have the json file at this location.

like image 404
L-Samuels Avatar asked Apr 23 '14 17:04

L-Samuels


1 Answers

If you are running standalone, you should make sure that your json file is in src/test/resources/__files

like image 167
Dave Avatar answered Nov 06 '22 11:11

Dave