Thanks, tried that & ended up with different e...
# spring
a
Thanks, tried that & ended up with different errors, think I have created a sort of hybrid Unit Test. Will probably just go with the manual creation of the MockMvc for the time being as it allows me to test the controller interface whilst mocking out the backing services.
s
You can setup it as an integration test and use @MockBean on all the beans that the controller is depending on. Beans annotated with MockBean are Mockito beans injected into the Context.
a
I am looking to keep it as lightweight as possible & don't want to spin up a whole Spring Boot context if I can help it.
m
@WebMvcTest only does the base context, the webmvc config, security, and serialization (enough to “hit the endpoints with all their magic)