import static org.mockito.Mockito.when;
public class ThreadDeadlockHealthCheckTest {
@Test
public void isHealthyIfNoThreadsAreDeadlocked() throws Exception {
final ThreadDeadlockDetector detector = mock(ThreadDeadlockDetector.class);
final ThreadDeadlockHealthCheck healthCheck = new ThreadDeadlockHealthCheck(detector);
when(detector.getDeadlockedThreads()).thenReturn(Collections.<String>emptySet());
assertThat(healthCheck.execute().isHealthy())
.isTrue();
}