我们可以用JMockit-1.30版本运行JUnit5吗?

时间:2018-01-05 05:01:53

标签: jmockit eclipse-mars junit5

当我们将Junit5与Jmockit1.30一起使用时显示NullPointerException,但与Jmockit 1.37(最新版本)配合使用

这是我执行RunWith(JUnitPlatform.class)的代码:

public class Junit5WithJmockitTest 
{ 
  Tested private User user; 
  Mocked private Department department; 
  Test void testjunit5WithJmockit37Test()
  { 
    new Expectations() 
    { 
      { 
        department.getDepartmentId(); 
        result = 1; 
        new Department(); 
        result = department; 
      } 
    }; 
    user.getUserId(); 
    AssertionUtils.assertNotNull("", user); 
  } 
} 

0 个答案:

没有答案