title: how to exclude configuration in spring integration test?
body: <p>in my test directory, structured like</p>
  <p><code>/test/java/controller/ControllerConfig.java</code></p>
  <p><code>/test/java/controller/SomeControllerTest.java</code></p>
  <p><code>/test/java/service/SomeServiceTest.java</code></p>
  <p>ControllerConfig like</p>
  <pre><code>@TestConfiguration
  @ComponentScan(basePackages = {
          &quot;xxxxx&quot;})
  @Import(OtherConfig.class)
  public class ControllerConfig {
      @MockBean
      private ServiceA serviceA...
  }
  </code></pre>
  <p>SomeService.java</p>
  <pre><code>@SpringBootTest
  @ActiveProfiles(&quot;test&quot;)
  @Slf4j
  public class SomeServiceTest {
    @Autowired
    ServiceA serviceA;
  }
  </code></pre>
  <p>I use controllerConfig only for controller test.But When I run service tests the ServiceA is mocked!! I don't know why. I know @SpringBootTest search for top @SpringBootApplication  but my app is like</p>
  <pre><code>@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, RedisAutoConfiguration.class})
  @EnableTransactionManagement
  @ImportResource(&quot;classpath:/ac.xml&quot;)
  @EnableScheduling
  public class StartApp {
      public static void main(String[] args) {
          SpringApplication.run(StartApp.class, args);
      }
  }
  </code></pre>
  <p>how Can I not collect controllerConfig in Service test?</p>