If you're building Spring (Boot) web APIs, you may be using [Spring Cloud Contract](https://spring.io/projects/spring-cloud-contract) for Consumer Driven Contract testing, to ensure that you're not pushing out breaking changes to your APIs.
In the case you're using MockMVC as your HTTP client layer, you may have a base test class defined similar to the documentation:
```java
// via https://docs.spring.io/spring-cloud-contract/docs/3.1.0/reference/html/getting-started.html#getting-started-first-application-producer
However, you'll note that this requires you adding each controller manually.
You may amend it so you can make each controller `@Autowired` when running under `@SpringBootTest`, so you don't have to construct them all, but it still doesn't really scale nicely in the case you've got quite a few controllers, or that you're adding on extra work each time you want to introduce a new controller.
To make this easier, we can take one of two approaches to automagically wire in all our controllers:
# Using the `WebApplicationContext`
The easiest way of doing this is to hook in an autowired `WebApplicationContext` which will have all the context required for the MockMVC setup: