Ekaterina Blech
05/15/2025, 12:29 PMEkaterina Blech
05/15/2025, 12:31 PMEkaterina Blech
05/15/2025, 12:31 PMcat mock/docker-compose.yml 1/s001 [15:25:12]
services:
wiremock:
image: "wiremock/wiremock:latest"
container_name: wiremock
entrypoint: ["/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose"]
expose:
- 8080
- 5000
ports:
- "8080:8080"
- "5000:5000"
volumes:
- ./extensions:/var/wiremock/extensions
- ./__files:/var/wiremock/__files
- ./mappings:/var/wiremock/mappings
Ekaterina Blech
05/15/2025, 12:31 PMEkaterina Blech
05/15/2025, 12:31 PMcurl --request POST \ 0/s001 [15:25:28]
--url <http://localhost:8080/__admin/mappings> \
--header 'Content-Type: application/json' \
--header 'User-Agent: insomnia/10.3.1' \
--data '{
"name": "Hello world!",
"request": {
"method": "GET",
"url": "/some/thing",
"port": 5000
},
"response": {
"status": 200,
"body": "Hello world!",
"headers": {
"Content-Type": "text/plain"
}
}
}'
{
"id" : "5fec9412-331a-468e-8ec9-4e8b891be9ad",
"name" : "Hello world!",
"request" : {
"port" : 5000,
"url" : "/some/thing",
"method" : "GET"
},
"response" : {
"status" : 200,
"body" : "Hello world!",
"headers" : {
"Content-Type" : "text/plain"
}
},
"uuid" : "5fec9412-331a-468e-8ec9-4e8b891be9ad"
}%
Ekaterina Blech
05/15/2025, 12:31 PMEkaterina Blech
05/15/2025, 12:31 PM{
"mappings": [
{
"id": "5fec9412-331a-468e-8ec9-4e8b891be9ad",
"name": "Hello world!",
"request": {
"port": 5000,
"url": "/some/thing",
"method": "GET"
},
"response": {
"status": 200,
"body": "Hello world!",
"headers": {
"Content-Type": "text/plain"
}
},
"uuid": "5fec9412-331a-468e-8ec9-4e8b891be9ad"
}
],
"meta": {
"total": 1
}
}
Ekaterina Blech
05/15/2025, 12:32 PMEkaterina Blech
05/15/2025, 12:32 PMcurl --request GET --url <http://localhost:5000/some/thing> --header 'User-Agent: insomnia/10.3.1'
curl: (56) Recv failure: Connection reset by peer
Ekaterina Blech
05/15/2025, 12:32 PMroot@6f085eb0456e:/home/wiremock# curl --request GET --url <http://localhost:5000/some/thing> --header 'User-Agent: insomnia/10.3.1'
curl: (7) Failed to connect to localhost port 5000 after 0 ms: Couldn't connect to server
Ekaterina Blech
05/15/2025, 12:32 PMEkaterina Blech
05/15/2025, 12:36 PMLee Turner
05/15/2025, 12:43 PM--port
option to start wiremock on port 5000
https://wiremock.org/docs/standalone/java-jar/#command-line-optionsEkaterina Blech
05/15/2025, 12:46 PMEkaterina Blech
05/15/2025, 12:48 PMEkaterina Blech
05/15/2025, 12:49 PMLee Turner
05/16/2025, 9:34 AM/invoices
, /payments
for example) so they run one instance and their stubs don't interfere with each otherVadim Chekulaev
05/16/2025, 2:45 PMVadim Chekulaev
05/16/2025, 2:45 PMVadim Chekulaev
05/20/2025, 7:21 AMVadim Chekulaev
05/22/2025, 7:17 AMLee Turner
05/22/2025, 2:21 PMVadim Chekulaev
05/22/2025, 3:02 PM--port
property for that, but it seems that it accepts only a single port.Lee Turner
05/23/2025, 8:13 AM