SpringBootTest : No qualifying bean of type ‘org.springframework.test.web.servlet.MockMvc’ available:
Hope you have spring-boot-starter-web dependency. Not sure which version of Spring boot you use, but build mockMvc this way instead? @RunWith(SpringRunner.class) @SpringBootTest public class ApplicationTest { @Autowired private WebApplicationContext webApplicationContext; private MockMvc mockMvc; @Before public void setUp() { mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); }