I\'m unable to configure correctly the security in my tests. My web security configuration:
@Configuration @EnableWebMvcSecurity public class WebSecurityConf
Make the following modifications to your code:
@Autowired private FilterChainProxy filterChainProxy; @Before public void setUp() { MockitoAnnotations.initMocks(this); this.mockMvc = webAppContextSetup(wac).dispatchOptions(true).addFilters(filterChainProxy).build(); }