我正在尝试使用 spring 和 gradle 为项目编写一些 junit 测试。我越来越
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.boot.test.autoconfigure.AutoConfigureReportTestExecutionListener.prepareTestInstance(AutoConfigureReportTestExecutionListener.java:49)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
我被告知这可能是弹簧组件不兼容的问题。这些是我的 gradle.properties 中的那些
SpringSecurityConfig = 4.0.2.RELEASE
SpringSecurityWeb = 4.0.2.RELEASE
SpringWeb = 4.3.6.RELEASE
SpringWebMVC = 4.3.6.RELEASE
SpringBootTestAutoConfigure = 1.4.0.RELEASE
SpringSecurityTest = 4.0.2.RELEASE
SpringContextVersion = 4.1.7.RELEASE
SpringTestVersion = 4.3.6.RELEASE
SpringBootTestVersion = 1.2.5.RELEASE
SpringBootStarterVersion = 1.2.5.RELEASE
SpringDataRedisVersion = 1.6.4.RELEASE
SpringRetryVersion = 1.2.0.RELEASE
SpringDataJpaVersion = 1.8.0.RELEASE
我如何确定其中哪些不兼容?
守着一只汪
相关分类