Search in sources :

Example 11 with Check

use of com.ecwid.consul.v1.health.model.Check in project spring-cloud-consul by spring-cloud.

the class TtlSchedulerTests method should_send_a_check_before_ttl_for_all_services.

@Test
public void should_send_a_check_before_ttl_for_all_services() throws InterruptedException {
    // Wait for TTL to expired (TTL is set to 2 seconds)
    Thread.sleep(2100);
    Check serviceCheck = getCheckForService("ttlScheduler");
    assertThat(serviceCheck).isNotNull();
    assertThat(serviceCheck.getStatus()).isEqualTo(PASSING).as("Service check is in wrong state");
    Check serviceManagementCheck = getCheckForService("ttlScheduler-management");
    assertThat(serviceManagementCheck).isNotNull();
    assertThat(serviceManagementCheck.getStatus()).isEqualTo(PASSING).as("Service management check is in wrong state");
}
Also used : Check(com.ecwid.consul.v1.health.model.Check) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

Check (com.ecwid.consul.v1.health.model.Check)7 Test (org.junit.Test)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 NewService (com.ecwid.consul.v1.agent.model.NewService)4 ArrayList (java.util.ArrayList)2 List (java.util.List)2 JSONObject (com.alibaba.fastjson.JSONObject)1 QueryParams (com.ecwid.consul.v1.QueryParams)1 Service (com.ecwid.consul.v1.agent.model.Service)1 HealthService (com.ecwid.consul.v1.health.model.HealthService)1 Server (com.netflix.loadbalancer.Server)1 Map (java.util.Map)1