Slide 30
Slide 30 text
WireMock Example #1
Easy to use. Modify mock API without restarting.
{
"request": {
"method": "GET",
"url": "/something"
},
"response": {
"body": "Hello world!",
"headers": {
"Content-Type": "text/plain"
},
"status": 200
}
}
> java -jar wiremock-jre8-standalone-2.34.0.jar --port
8080
> curl -X POST --data {json String}
http://localhost:8080/__admin/mappings
> curl -X POST
http://localhost:8080/__admin/mappings/save
> curl http://localhost:8080/__admin/
{
"id" : "746e0a7c-84b3-4837-830a-f228ce381a41",
"request" : {
"url" : "/something",
"method" : "GET"
},
...
> curl http://localhost:8080/something
Hello world!
mockAPI.json