Last active
September 16, 2019 13:33
-
-
Save thanglequoc/04a89c6ee41d7dbe9c063daaf98c9821 to your computer and use it in GitHub Desktop.
Spring Boot Test Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //@ContextConfiguration(classes = { H2ContextConfiguration.class }) | |
| //@EnableAutoConfiguration | |
| //@TestPropertySource(locations = "classpath:/application-test.properties") | |
| //@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) | |
| //@EnableAutoConfiguration | |
| //@SpringBootTest(classes = OrderServiceIntegrationTestContext.class, webEnvironment = SpringBootTest.WebEnvironment.NONE) | |
| //@RunWith(SpringRunner.class) | |
| //@ContextConfiguration(classes = { H2ContextConfiguration.class }) | |
| //@EnableAutoConfiguration | |
| //@TestPropertySource(locations = "classpath:/application-test.properties") | |
| //@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) | |
| @RunWith(SpringRunner.class) | |
| @ComponentScan( | |
| includeFilters = { | |
| @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, | |
| value = { OrderService.class, OrderServiceImpl.class}) | |
| }, | |
| excludeFilters = { | |
| @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, | |
| value = { DatabaseConfiguration.class, ActivitiBPMConfiguration.class, ElasticsearchConfiguration.class, | |
| ElasticSearchUpdater.class, CacheConfiguration.class, MetricsConfiguration.class}), | |
| @ComponentScan.Filter(type = FilterType.REGEX, | |
| pattern = {"vn.nextlogix.repository.search.*"})}) | |
| public class OrderServiceIntegrationTestContext { | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment