Search in sources :

Example 1 with HealthCheck

use of org.apache.servicecomb.registry.api.registry.HealthCheck in project java-chassis by ServiceComb.

the class TestMicroserviceInstanceRegisterTask method setup.

@Before
public void setup() {
    ConfigUtil.installDynamicConfig();
    eventBus = new EventBus();
    taskList = new ArrayList<>();
    eventBus.register(new Object() {

        @Subscribe
        public void onEvent(MicroserviceInstanceRegisterTask task) {
            taskList.add(task);
        }
    });
    microservice = new Microservice();
    microservice.setAppId("app");
    microservice.setServiceName("ms");
    microservice.setServiceId("serviceId");
    microservice.setInstance(new MicroserviceInstance());
    HealthCheck healthCheck = new HealthCheck();
    healthCheck.setMode(HealthCheckMode.HEARTBEAT);
    microservice.getInstance().setHealthCheck(healthCheck);
}
Also used : Microservice(org.apache.servicecomb.registry.api.registry.Microservice) HealthCheck(org.apache.servicecomb.registry.api.registry.HealthCheck) MicroserviceInstance(org.apache.servicecomb.registry.api.registry.MicroserviceInstance) EventBus(com.google.common.eventbus.EventBus) Subscribe(com.google.common.eventbus.Subscribe) Before(org.junit.Before)

Aggregations

EventBus (com.google.common.eventbus.EventBus)1 Subscribe (com.google.common.eventbus.Subscribe)1 HealthCheck (org.apache.servicecomb.registry.api.registry.HealthCheck)1 Microservice (org.apache.servicecomb.registry.api.registry.Microservice)1 MicroserviceInstance (org.apache.servicecomb.registry.api.registry.MicroserviceInstance)1 Before (org.junit.Before)1