Best bits of https://spring.io/guides/gs/testing-web/:
testCompile("org.springframework.boot:spring-boot-starter-test")
@AutoConfigureMockMvc
on your test class, injects a MockMvc
instance when you Autowired
one.
(You'll probably need @RunWith(SpringRunner.class)
and @SpringBootTest
too.)