简体   繁体   中英

Spring ContextConfiguration Initializers not run under maven test

I have a Junit test running flawlessely within a Spring application context. The application context includes two xml files as well as an initializer. The JUnit base class is as follows:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration( locations = { "classpath:/applicationContext.xml", 
                                     "classpath:/applicationcontext-security.xml"}, 
                                     initializers = com.abc.ConfigurationInitializer.class )
@TransactionConfiguration
@Transactional
public abstract class BaseTest extends AbstractTransactionalJUnit4SpringContextTests
{......

However when running the test under maven the application context fails to load and this is because the initializer class is not run.

Why is the Initializer(s) class not being run?

我的坏-初始化程序运行后不久就崩溃了

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM