junit4.12 和Spring不兼容导致,注入SpringJUnit4ClassRunner.class失败,对dao层测试匹配不到相关bean。

junit4.12 和Spring不兼容导致,注入SpringJUnit4ClassRunner.class失败,对dao层测试匹配不到相关bean。
Spring—test与junit版本号不匹配,导致对dao层数据进行测试不能找到相关测试
java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=testhhhx], {ExactMatcher:fDisplayName=testhhhx(com.wx.webPostgraExam.daoTest.QuestionArrTest)],

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {“classpath:applicationContext.xml”})

太搞了,这个错误找了很多解决办法,差点把整个框架给搞崩了。

然后重新改版本号,改了很多个版本最后终于解决了

junit4.12 和Spring版本4.3.14.RELEASE,终于可以测试了