I have the following test class:
@ActiveProfiles({ \"DataTC\", \"test\" })
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {BaseTestC
One of your @Configuration classes is obviously annotated with @EnableWebMvc. That's how DelegatingWebMvcConfiguration ends up in your stack trace, since it is imported by @EnableWebMvc.
So although you think you don't need a WebApplicationContext (and hence a ServletContext), you in fact do need it simply because you are loading an application context with @EnableWebMvc.
You have two options:
@Configuration class(es) annotated with @EnableWebMvc).@WebAppConfiguration as suggested in other comments above.Regards,
Sam (author of the Spring TestContext Framework)