1 Star 0 Fork 1

thinkyoutoo / security-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
3-2_查询请求.md 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
Corning Sun 提交于 2018-03-16 14:41 . 3-2 查询请求

3-2 查询请求

编写第一个 RESTful API

  • 编写针对 RESTful API 的测试用例
  • 使用注解声明 RESTful API
  • 在 RESTful API 中传递参数

常用注解

  • @RestController 标明此 Controller 提供 RESTAPI
  • @RequestMapping及其变体 映射 http 请求 url 到 java 方法
  • @RequestParam 映射请求参数到 java 方法的参数
  • @PageableDefault 指定分页参数默认值

问题整理

编写针对 RESTful API 的测试用例

使用注解声明 RESTful API

  • java.lang.AssertionError: No value at JSON path "$.length()", exception: json can not be null or empty

    问题原因:UserController 的 查询方法返回 null

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/thinkyoutoo/security-1.git
git@gitee.com:thinkyoutoo/security-1.git
thinkyoutoo
security-1
security-1
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891