Postman测试工具
post请求
头部携带token
类型选择JSON
接口测试工具swagger
swagger2,较多
swagger3,
Knife4j
Knife4j的前身是swagger-bootstrap=ui,前身swagger–bootstrap-ui是一个纯swagger–ui的ui皮肤项目
https://doc.xiaominfo.com/docs/quick-start
1.引入依赖
底层就是swagger
2.配置
3.常用注解
序号 | 注解 | 作用 |
---|---|---|
1 | @Api(tags = “图书的api接口类”) | 左侧名字 |
2 | @ApiOperation(“findPage方法测试”) | get方法名字 |
3 | @ApiImplicitParam(name = “findByPage”,value = “分页查询”,required = true) | 参数相关 |
4 | @ApiModel(“DTO返回数据”) | 写在HttpResp实体类上 |
5 | @ApiModelProperty(“time”) | 写在HttpResp类属性上 |
BookController.java文件
HttpResp.java返回给前端的实体类
4.接口测试
ip: 端口/doc.html
JMeter
什么是JMeter?
Apache JMeter?
The Apache JMeter? application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance(接口性能),It was originally designed for testing Web Applications but has since expanded to other test functions.