-
enum 定义及用法查看全部
-
Aspect record log items and methods查看全部
-
Aspect record log items and methods查看全部
-
Aspect record log查看全部
-
spring只对run timeexception回滚查看全部
-
controllerAdvice 异常注解 responseBody查看全部
-
RequestContextHolder查看全部
-
@Aspect @查看全部
-
日志记录返回查看全部
-
记录日志查看全部
-
log日志查看全部
-
测试service @RunWith(SpringRunner.class) @SpringBootTest public class GrilServiceTest { @Autowired private GirlService girlService; @Test public void findOneTest() { Girl girl=girlService.findOne(2); Assert.assertEquals(new Integer(15), girl.getAge()); } }查看全部
-
测试controller @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureMockMvc public class GrilController { @Autowired private MockMvc mvc; @Test public void girlList() throws Exception { mvc.perform( MockMvcRequestBuilders.get("/girl/girls")) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.content().string("abc")); } }查看全部
-
mvn package会执行测试 让mvn打包时跳过测试命令:查看全部
-
=============ResultUitl ============ public class ResultUitl { public static Result success(Object object) { Result result=new Result(); result.setCode(0); result.setMsg("成功"); result.setData(object); return result; } public static Result success() { return success(null); } public static Result error(Integer code,String mes) { Result result=new Result(); result.setCode(code); result.setMsg(mes); return result; } }查看全部
举报
0/150
提交
取消