私は次のコードを持っています:
class Sleeper {
public void sleep(long duration) {
try {
Thread.sleep(duration);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
JMockitを使用して、Thread.sleep()がInterruptedExceptionをスローした場合にThread.currentThread()。interrupt()が呼び出されることをテストするにはどうすればよいですか?