Şöyle yaparız
version: '3.9'services:todo-service:image: wiremock/wiremock:2.32.0container_name: todo-servicevolumes:- ./local-setup:/home/wiremockports:- 8383:8080
local_setup __files mapppings docker-compose.yml
//get-todos.json
docker-compose.yml{
"request": {
"method": "GET",
"urlPathPattern": "/api/v1/todos"
},
"response": {
"status": 200,
"jsonBody": [
{
"id": "d8b25784-c16f-449a-9006-6972e8a9111b",
"title": "Clean House",
"active": true,
"created": "2022-04-11"
},
{
"id": "38ab7f0f-0cdc-4643-8cdb-42acf7d1a4c4",
"title": "Clean Car",
"active": true,
"created": "2022-04-12"
}
],
"headers": {
"Content-Type": "application/json"
}
}
}
//get-todo.json
{
"request": {
"method": "GET",
"urlPathPattern": "/api/v1/todos/d8b25784-c16f-449a-9006-6972e8a9111b"
},
"response": {
"status": 200,
"jsonBody": {
"id": "d8b25784-c16f-449a-9006-6972e8a9111b",
"title": "Clean House",
"active": true,
"created": "2022-04-11"
},
"headers": {
"Content-Type": "application/json"
}
}
}
//get-todo-not-found.json
{
"priority": 2,
"request": {
"method": "GET",
"urlPathPattern": "/api/v1/todos/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"
},
"response": {
"status": 404,
"headers": {
"Content-Type": "application/json"
}
}
}
Hiç yorum yok:
Yorum Gönder