【发布时间】:2021-09-30 06:22:47
【问题描述】:
我可以使用 try-catch 为以下代码编写单元测试吗?
if (currentAZ == null) {
throw new IllegalStateException("Cannot fetch Current AZ information.");
}
【问题讨论】:
-
为什么需要一个 try catch 来测试它?
标签: java unit-testing testing