diff options
Diffstat (limited to 'service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorTest.java')
-rw-r--r-- | service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorTest.java | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorTest.java deleted file mode 100644 index 94ba4726ad0..00000000000 --- a/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorTest.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.service.health; - -import com.yahoo.vespa.applicationmodel.ServiceStatus; -import org.junit.Test; - -import java.time.Duration; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class HealthMonitorTest { - @Test - public void initiallyDown() { - HealthClient healthClient = mock(HealthClient.class); - try (HealthMonitor monitor = new HealthMonitor(healthClient, Duration.ofHours(12))) { - monitor.startMonitoring(); - assertEquals(ServiceStatus.DOWN, monitor.getStatus()); - } - } - - @Test - public void eventuallyUp() { - HealthClient healthClient = mock(HealthClient.class); - when(healthClient.getHealthInfo()).thenReturn(HealthInfo.fromHealthStatusCode(HealthInfo.UP_STATUS_CODE)); - try (HealthMonitor monitor = new HealthMonitor(healthClient, Duration.ofMillis(10))) { - monitor.startMonitoring(); - - while (monitor.getStatus() != ServiceStatus.UP) { - try { - Thread.sleep(1); - } catch (InterruptedException e) { - // ignore - } - } - } - } -}
\ No newline at end of file |