Why the cryptic MultipleFailureException error message with the SpringJUnit4ClassRunner.withAfterClasses method

后端 未结 1 504
没有蜡笔的小新
没有蜡笔的小新 2021-02-13 18:16

Why is my spring test set up failing with the following not-so-useful error messages below? All suggestions are appreciated.

JUnit Output



        
1条回答
  •  迷失自我
    2021-02-13 19:20

    Update -- September 2015

    Spring Framework 4.2.2 throws a more meaningful exception if JUnit 4.9 is not in the classpath. See SPR-13521 for details.


    The following is an excerpt from the class-level Javadoc for SpringJUnit4ClassRunner:

    NOTE: As of Spring Framework 4.1, this class requires JUnit 4.9 or higher.

    The class in question, MultipleFailureException, was introduced in JUnit 4.9.

    So that's why your test is failing with the ClassNotFoundException.

    Upgrading to JUnit 4.9 (or preferably 4.12) will therefore solve your problem.

    Regards,

    Sam (author of the Spring TestContext Framework)

    0 讨论(0)
提交回复
热议问题