问题描述
我在下面的代码中做错了什么?有人可以提出建议吗。
@RunWith(JUnit4.class)
class testingClasstest {
//Added annotations on the classes
@InjectMocks
private TestingClass testClassObj;
@Mock
DO dO;
private Exception ex;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
dO = new DO();
}
//method to be tested
@Test
void testProcess() {
dO = new dO();
ex = new MyException(new ArrayList<>(),null);
new MockUp<Mockingclass>() {
@mockit.Mock
public void method(Object obj,String st,Exception ex,String msg,ObjectConfig obj) {
dO.setCd(Interfacecontaingconst.CD);
}
};
testObj.method(DO,"6",ex,null,null);
Assert.assertEquals(139,dO.getCd());
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)