我对使用MockMvc有疑问。这里我有一些简单的服务和控制器类:@Slf4jpublic class EmployeeService { return new ResponseEntity<>(employee, HttpStatus.OK);}
测试(MockMvcRequestBuilders.post("/info/Ge
与Authentication token passed to ControllerAdvice is null when running through MockMvc类似,我使用Spring DataREST和Spring Security对Spring Boot 1.5.16应用程序进行的MockMvc测试总是有一个空Authentication参数,无论我是手动添加上下文还是使用@WithUserDetails这是Spring Security的测试代码中的一个