finally 块中异常的 Junit 覆盖

问题描述

我正在尝试模拟 finally 块中的 close 方法。以便 Exception 也包含在覆盖范围内。

Respose response = null;
.....
finally {
  try {
    response.close();
  }catch (IOException exp) {
    System.out.println(exp);
  }
}

junit 覆盖范围未涵盖 SOP。

单元测试片段

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)