I am using Spring for MVC tests
Here is my test class
@RunWith(SpringRunner.class)
@WebMvcTest
public class ITIndexController {
@Autowired
W
Not sure if this was available when the original question was asked, but if truly not wanting to test the security portion of a web request (which seems reasonable if the endpoint is known to be unsecure), then I think this could be done simply by using the secure
attribute of the @WebMvcTest
annotation (it defaults to true
so setting it to false
should disable the auto-configuration of Spring Security's MockMvc support):
@WebMvcTest(secure = false)
More info available in the javadocs