title: Override a single @Configuration class on every spring boot @Test
body: <p>On my spring boot application I want to override just one of my <code>@Configuration</code> classes with a test configuration (in particular my <code>@EnableAuthorizationServer</code> <code>@Configuration</code> class), on all of my tests.</p>
  
  <p>So far after an overview of <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html" rel="noreferrer">spring boot testing features</a> and <a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/integration-testing.html" rel="noreferrer">spring integration testing features</a> no straightforward solution has surfaced:</p>
  
  <ul>
  <li><code>@TestConfiguration</code>: It's for extending, not overriding;</li>
  <li><code>@ContextConfiguration(classes=…​)</code> and <code>@SpringApplicationConfiguration(classes =…​)</code> let me override the whole config, not just the one class;</li>
  <li>An inner <code>@Configuration</code> class inside a <code>@Test</code> is suggested to override the default configuration, but no example is provided;</li>
  </ul>
  
  <p>Any suggestions?</p>