title: How to exclude classes that are added using Spring's AutoConfiguration when using @WebMvcTest?
body: <p>I want to test my Controller using <code>@WebMvcTest</code> and mock the dependencies, but Spring Boot's AutoConfiguration loads my Couchbase (Spring Data) configuration automatically. Couchbase is not available on some platforms which run the test, so the Test class will throw an Exception. How can I exclude some classes from the AutoConfiguration mechanism?</p>
  
  <p>I tried the <code>excludeFilters</code> option of <code>@WebMvcTest</code> and <code>@ActiveProfile</code> to load another Application Context, but that didn't work.</p>
  
  <p>Test configuration:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @WebMvcTest(value = ExchangeJobImportController.class, excludeFilters = @ComponentScan.Filter(classes = CouchbaseConfiguration.class))
  @ActiveProfiles("test")
  public class ExchangeJobImportControllerTest {
    ...
  }
  </code></pre>
  
  <p>Couchbase Configuration:</p>
  
  <pre><code>@Configuration
  @EnableCouchbaseAuditing
  @EnableConfigurationProperties({CouchbaseProperties.class})
  @EnableCouchbaseRepositories(basePackages = "com....")
  public class CouchbaseConfiguration extends AbstractCouchbaseConfiguration {
    ...
  }
  </code></pre>