mock使用:
使用moco框架 启动mock:
1.下载jar包准备 :moco-runner-0.11.0-standalone.jar
2.用命令启动 : java -jar ./moco-runner-0.11.0-standalone.jar http -p 8080 -c startup.json
3.浏览器访问 :http://ip:8080/demo
startup.json文件内容
[
{ "description": "这是我们的第一个mock例子",
"request": {
"uri": "/demo"
},
"response": {
"text": "第一个mock框架"
}
},
{ "description": "mock模拟一个没有参数的get请求",
"request": {
"uri": "/getDemo",
"method": "get"
},
"response": {
"text":"这是一个没有带参数的get请求"
}
},
{
"description": "mock模拟一个有参数的get请求",
"request": {