要使用 Spring Security 的实现,请使用以下静态导入:RequestPostProcessorspring-doc.cn

import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*