Exclude a particular class from Spring Component scan while writing Spring Integration Test
问题 My classes are.. lies in src/intregation-test/java @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = StoreOrderFulfillmentApplication.class) @ActiveProfiles("Test") public class OrderCreationIntregationTest { @Autowired private TestRestTemplate restTemplate; @MockBean private OrderRepository orderRepository; @MockBean private OrderLineItemRepository orderLineItemRepository; @MockBean private InternalEventPublisher internalEventPublisher;