I already add @SpringBootTest
in all testcase.
'Run all test' in IDEA is OK, but when I use Maven test
it didn't work.
how to reuse context in Maven test
commend.
has any friend meet this problem? thx!
my test case like this:
@SpringBootTest
class EventControllerTest extends BaseTester{
...
}
@RunWith(SpringRunner::class)
@SpringBootTest
class BaseTester{}
maven log:
2018-07-04 16:09:38.766 INFO [-,,,] 12601 --- [ Thread-9] o.s.w.c.s.GenericWebApplicationContext : Closing org.springframework.web.context.support.GenericWebApplicationContext@2577d6c8: startup date [Wed Jul 04 16:09:29 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@54eb2b70 2018-07-04 16:09:38.792 INFO [-,,,] 12601 --- [ Thread-9] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' Running com.fintend.ctc.controller.InviteControllerTest 16:09:40.535 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class com.fintend.ctc.controller.InviteControllerTest] 16:09:40.541 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate] 16:09:40.549 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)] 16:09:40.570 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test c