Angela Yuan
06/27/2024, 5:17 PMhttp://localhost:8080/some/thing
, it just returns a "Not Found" error. Does anyone know what might be causing this problem, such as if I'm not starting WireMock properly, etc.? For context, my .json file is in a folder, and I moved into the auto-generated mappings folderBas Dijkstra
06/27/2024, 5:25 PMAngela Yuan
06/27/2024, 5:38 PM{
"request": {
"method": "GET",
"url": "/api/repo/bitbucket.org/atlassian/nodejs-stack-tools-api/some_url/persist"
},
"response": {
"status": 429,
"body": "Hello, world!",
"headers": {
"Content-Type": "text/plain"
}
}
}
And I'm actually not sure if I started WireMock correctly, which might be the problem? I followed this doc, and ran this command to start a Docker image (so, not on port 8080 because my application I'm trying to use WireMock on is running on 8080). I don't know if this is the right way to start WireMock, and/or if there's more to it:
docker run -it --rm \
-p 8082:8080 \
--name wiremock \
-v $PWD:/home/wiremock \
wiremock/wiremock:3.7.0
Bas Dijkstra
06/27/2024, 5:58 PM/some/thing
? Or are you actually calling the endpoint you mentioned in the stub mapping?
Does WireMock respond with a 404, or does it not respond at all?Angela Yuan
06/27/2024, 6:03 PM/some/thing
, and I was sending a GET request to http://localhost:8080/some/thing
in Postman. And in Postman, it responds with Not Found, and actually I do see a 404 in my terminal (a snippet of it below):
9,"method":"GET","host":"localhost:8080","remoteAddress":"::ffff:172.26.0.5","remotePort":50126,"url":"/some/
thing","ep":"GET /some/thing"},"res":{"headers":{"content-length":"9","content-type":"text/plain; charset=utf-8","x-b3
spanid":"4b26db6f8b9d1a2c","x-b3-traceid":"71c378849de171a0"},"ts":1719511327829,"time":10,"statusCode":404,"length":
9}}
Bas Dijkstra
06/27/2024, 6:28 PMAngela Yuan
06/27/2024, 6:36 PM<http://localhost:*8082*/api/repo/bitbucket.org/atlassian/nodejs-stack-tools-api/some_url/persist>
instead of 8080, which seemed to help because I now receive a different error: No response could be served as there are no stub mappings in this WireMock instance.
Looking into documentation, it seems to say WireMock expects stub files in home/wiremock/mappings
in the Docker container, which I'm not sure how to exactly achieve... I'm not sure if this is on the right track?Bas Dijkstra
06/27/2024, 6:41 PMmapping
and __files
folders automatically when it first starts. Maybe someone else can shed more light on this?Lee Turner
06/27/2024, 9:15 PMAngela Yuan
06/28/2024, 1:41 PM