Download Standalone Moco Runner Write your own configuration file to describe your Moco server configuration as follow:[ { "response" : { "text" : "Hello, Moco" } } ](foo.json)Run Moco HTTP server with the configuration file.java -jar moco-runner-<version>-standalone.jar http -p 12306...
Download Standalone Moco Runner Write your own configuration file to describe your Moco server configuration as follow:[ { "response" : { "text" : "Hello, Moco" } } ](foo.json)Run Moco HTTP server with the configuration file.java -jar moco-runner-<version>-standalone.jar http -p 12306...
某依赖系统还未开发完成,就需要对被测系统进行测试 三、mock工具:moco-runner 1、moco-runner下载 https://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/0.12.0 2、moco-runner 常用属性 3、构造接口放到json文件中 [{ "description": "get请求", "request": { "uri": "/login/1", "method...
http://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/0.12.0/ 一看到jar后缀,说明运行该文件需要java环境,不了解的可以找相关资料提前把java环境搭建好 如何使用 moco-runner,例如我们测试登录接口,可以将mock接口放到login.json文件中 login.json内容如下: [ { "description":"这是一个带参数的get...
电脑要配置java环境,配置方法自行百度 下载jar包:https://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/0.11.0/ 新建mocorunner文件夹并把下载的jar文件放在此目录中,新建文件test.json放在新建的文件夹中 test.json文件中输入如下内容并保存 ...
下载moco-runner的Jar包: https://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/0.12.0/moco-runner-0.12.0-standalone.jar 准备环境:Windows并且安装Java环境。 5、Get请求如何模拟呢? 配置文件config.json GET请求定义访问路径和数据格式,如下: ...
http://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/0.12.0/ 一看到jar后缀,说明运行该文件需要java环境,不了解的可以找相关资料提前把java环境搭建好 如何使用 moco-runner,例如我们测试登录接口,可以将mock接口放到login.json文件中 login.json内容如下: ...
https://github.com/dreamhead/moco/tree/master/moco-runner/src/test/resources ◆moco的不足 使用moco有二周的时间了,暂时总结了两点不足: 1. 新添加的json文件,不能立即生效,需要重启moco-runner-<version>-standalone.jar,如果多人同时使用moco,新增或者更新mock时,需要协调通知。
Moco是一个在GitHub上开源的模拟服务器工具,主要用于模拟HTTP、HTTPS和Socket协议的接口。这个框架主要应用于单元测试,帮助开发者在测试阶段生成模拟数据,模拟后端接口,从而让前端能够在没有真实后端服务的情况下进行开发和测试。Moco框架的主要特点包括: 支持API和独立运行两种方式:Moco既可以在JUnit等测试框架中使用(API...
<path-to-moco-runner>:jar包的路径<monitor-port>:http服务监听的端口<configuration-file>:配置文件路径3>接口访问 打开浏览器,在浏览器地址栏中输入:2.4 Moco常用配置参数 定义请求方式,通过method参数定义 [{ "description": "首页", "request": { "uri": "/index", "method": "post...