moco学习

jar包下载地址:https://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/0.11.0/

json文件实例

[{
 "description":"模拟一个没有参数的get请求",
 "request":{
 "uri":"/getdemo",
 "method":"get"
 },
 "response":{
 "text":"这是一个没有参数的get请求"}
 },
{
 "description":"模拟一个带参数的get请求",
 "request":{
 "uri":"/getwithparam",
 "method":"get",
 "queries":{
 "name":"hujunjie","age":"18"}
 },
 "response":{
 "text":"这是一个带参数的get请求"}
 }
 ]

启动命令

java -jar ./moco-runner-0.11.0-standalone.jar http -p 8888 -c startup1.json

 

posted @ 2020-05-22 10:02  hjj123  阅读(69)  评论(0)    收藏  举报