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 product.json
其中 -p 为制定端口 -c 为指定文件
启动成功的标识:
java -jar moco-runner-0.11.0-standalone.jar http -p 12306 -c product.json #启动后的输出 14 ⼆⽉ 2022 09

最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



