我想为我的应用程序编写Junit测试以处理错误方法,它看起来像这样
public void myHandlingError(Throwable t) {//content}
Run Code Online (Sandbox Code Playgroud)
我想模拟Throwable对象,但我找不到任何例子.这就是我的想法......
public void myHandlingErrorTest(){
Throwable t = new Exception();
myClass.myHandlingError(t);
.
.
.
Run Code Online (Sandbox Code Playgroud)
任何建议将不胜感激!