【发布时间】:2020-09-03 02:58:46
【问题描述】:
我想通过使用 powermockito 来模拟以下方法以返回 true。
private boolean isResetPswrdLinkExpired(Timestamp timestamp) {
Calendar then = Calendar.getInstance();
then.setTime(timestamp);
then.getTime();
Calendar now = Calendar.getInstance();
Long diff = now.getTimeInMillis() - then.getTimeInMillis();
if (diff < 24 * 60 * 60 * 1000) {
return false;
} else {
return true;
}
}
【问题讨论】:
标签: java junit mockito powermock powermockito