wiremock docker 运行

使用docker 模式

  • docker-compose yaml
version: '3.3'
services:
  service1:
    image: rodolpheche/wiremock
    ports:
      - '9089:8080'
    volumes:
      - ./stubs:/home/wiremock/mappings
  • stubs
users.json
{
    "request": {
      "method": "GET",
      "url": "/users"
    },
    "response": {
      "status": 200,
      "jsonBody": [
        {
          "name":"dalong",
           "appversion":"v1"
        },
        {
          "name":"login",
          "appversion":"v1"
      },
      {
          "name":"user",
          "appversion":"v1"
      }
    ],
      "headers": {
          "Content-Type": "application/json"
      }
    }
  }
  • 运行
docker-compose up -d
http://localhost:9089/users

参考资料

http://wiremock.org/docs/

posted on 2018-08-01 22:01  荣锋亮  阅读(477)  评论(0编辑  收藏  举报

导航