Spring JUnit Test Error

后端 未结 6 1096
無奈伤痛
無奈伤痛 2020-12-16 09:17

I am receiving the following error when I attempt to run my Spring JUnit test. I am just trying to get familiar with creating JUnits using the Spring Framework.

JUni

6条回答
  •  一向
    一向 (楼主)
    2020-12-16 10:16

    If solutions above are not working, it might be eclipse's fault: in eclipse, on the project -> properties -> java build path -> Librairies -> if there is "Junit 4", remove it.

    I had this stacktrace:

    java.lang.NoSuchMethodError: org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runLeaf(Lorg/junit/runners/model/Statement;Lorg/junit/runner/Description;Lorg/junit/runner/notification/RunNotifier;)V
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
    

    And of course updating the pom wasn't the solution...

提交回复
热议问题