1、mockServer
1.1什么是mockServer
moco=替代 Server=服务
mocoServer即为测试替身的服务
主要针对于单元测试的应用,主要应用于解除单元测试之间的依赖
1.2mocoServer使用的场景
前端程序员
前端已经写好页面,但是后端的接口没有写好,
正确的姿势就是前端模拟后端的操作,具体方式如下
[ { "request": { "method": "get", "uri": "/products" }, "response": { "json": { "name": "我真帅", "type": "WEB", "version": "V1.0.0", "master": "aaaa", "description": "this is a test api" } } } ]
启动的命令为:
java -jar -moco-runner-0.10.0-standalone.jar http -p 12315 -c