I have the following method, and I'm trying my best to get 100% code coverage.
public final class SleepingHelper {
public static void sleepInMillis(Duration timeOfNextTry) {
try {
Thread.sleep(timeOfNextTry.toMillis());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
The question is how to make an Thread.sleepexception be thrown?
Edit: since it was marked as a duplicate, I'm still wondering what I will claim in the test? Another question is more general.
source
share