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/

猜你喜欢

转载自www.cnblogs.com/rongfengliang/p/9404206.html
今日推荐