JUnit tests pass in Eclipse but fail in Maven Surefire

前端 未结 17 1950
臣服心动
臣服心动 2020-11-29 17:28

I have written some JUnit tests using JUnit 4 and spring-test libraries. When I run the tests inside Eclipse then run fine and pass. But when I run them using Maven (during

17条回答
  •  [愿得一人]
    2020-11-29 18:01

    I had a similar problem: JUnit tests failed in Maven Surefire but passed in Eclipse when I used JUnit library version 4.11.0 from SpringSource Bundle Repository. Particulary:

    
        org.junit
        com.springsource.org.junit
        4.11.0
    
    

    Then I replaced it with following JUnit library version 4.11 and everything works fine.

    
        junit
        junit
        4.11
    
    

提交回复
热议问题