你好,请问在3-4中,
Date date = new Date();
System.err.println(date.getTime());
String content = "{\"username\":\"tom\",\"password\":\"123456\",\"birthday\":"+date.getTime()+"}";
String result = mockMvc.perform(MockMvcRequestBuilders.post("/user").contentType(MediaType.APPLICATION_JSON_UTF8).content(content)).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.jsonPath("$.id").value("1")).andReturn().getResponse().getContentAsString();
System.err.println(result);
为什么并没返回时间戳
而是返回
1537929047589
null
tom
123456
Wed Sep 26 10:30:47 CST 2018
{"id":"1","username":"tom","password":"123456","birthday":"2018-09-26T02:30:47.589+0000"}
“birthday”:“2018-09-26T02:30:47.589+0000”}
Spring Security技术栈,REST风格开发常见接口,独立开发认证授权模块保证REST服务安全
了解课程