作者简介:大家好,我是smart哥,前中兴通讯、美团架构师,现某互联网公司CTO
联系qq:184480602,加我进群,大家一起学习,一起进步,一起对抗互联网寒冬
查询请求
本章内容
-
如何编写测试用例
-
常用注解
-
RestController 提供RestAPI
-
RequestMapping及变体。映射http请求到java方法(变体下一章节讲解)
-
RequestParam 映射请求参数到java方法的参数
-
PageableDefault 指定分页参数的默认值
是spring data里面的,如果不使用该框架作为处理层,则不需要该对象
配合Pageable对象使用
-
如何编写测试用例
使用以下依赖
testCompile('org.springframework.boot:spring-boot-starter-test')
编写测试用例环境
@RunWith(SpringRunner.class)
@SpringBootTest
public class UserControllerTest {
@Autow