步骤一
环境准备
1. moco-runner-0.11.1-standalone.jar
2. java运行环境 (cmd去查看电脑是否有环境,java -version)
步骤二
moco环境搭建
1. moco的GitHub地址 https://github.com/dreamhead/moco ,可以根据实例进行操作
moco使用的jar包,链接: https://pan.baidu.com/s/12v9y2MTXohtgtqgUhMErZg 提取码: hhbw
2. 下载完成后,保存到电脑,然后和测试文件first.json同一文件夹下
first.json
[
{
"description" : "第一个接口",
"response": {
"text": "firstDemoRes"
}
}
]
3. 启动moco服务,cmd打开命令函,执行 java -jar moco-runner-0.11.1-standalone.jar http -p 9090 -c first.json
启动成功截图
4. 浏览器执行 http://localhost:9090/