1.下载moco的jar包,
下载地址:https://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/
选择自己需要的版本下载,如:/1.2.0/moco-runner-1.2.0-standalone.jar
2.自己创建一个配置文件test.json
与moco的jar包放在一个文件夹下面,test.json内容如下:
[
{
"description":"模拟一个没有参数的get请求",
"request":{
"uri":"/getdemo",
"method":"get"
},
"response":{
"text":"这是一个没有参数的get请求"
}
},
{
"description":"模拟一个带参的get请求",
"request":{
"uri":"/getwithparam",
"method":"get",
"queries": {
"name": "xianfang",
"age": "18"
}
},
"response":{
"text"