Search in sources :

Example 16 with ClusterMetadata

use of com.alibaba.nacos.naming.core.v2.metadata.ClusterMetadata in project nacos by alibaba.

the class HealthCheckProcessorV2DelegateTest method testProcess.

@Test
public void testProcess() throws NoSuchFieldException, IllegalAccessException {
    testAddProcessor();
    when(clusterMetadata.getHealthyCheckType()).thenReturn(HealthCheckType.TCP.name());
    when(healthCheckTaskV2.getClient()).thenReturn(new IpPortBasedClient("127.0.0.1:80#true", true));
    healthCheckProcessorV2Delegate.process(healthCheckTaskV2, service, clusterMetadata);
    verify(clusterMetadata).getHealthyCheckType();
    verify(healthCheckTaskV2).getClient();
}
Also used : IpPortBasedClient(com.alibaba.nacos.naming.core.v2.client.impl.IpPortBasedClient) Test(org.junit.Test)

Aggregations

ClusterMetadata (com.alibaba.nacos.naming.core.v2.metadata.ClusterMetadata)12 ServiceMetadata (com.alibaba.nacos.naming.core.v2.metadata.ServiceMetadata)7 Service (com.alibaba.nacos.naming.core.v2.pojo.Service)6 NacosException (com.alibaba.nacos.api.exception.NacosException)4 NamingMetadataOperateService (com.alibaba.nacos.naming.core.v2.metadata.NamingMetadataOperateService)3 HealthCheckInstancePublishInfo (com.alibaba.nacos.naming.core.v2.pojo.HealthCheckInstancePublishInfo)3 InstancePublishInfo (com.alibaba.nacos.naming.core.v2.pojo.InstancePublishInfo)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 HashMap (java.util.HashMap)3 Test (org.junit.Test)3 IpPortBasedClient (com.alibaba.nacos.naming.core.v2.client.impl.IpPortBasedClient)2 Cluster (com.alibaba.nacos.api.naming.pojo.Cluster)1 Instance (com.alibaba.nacos.api.naming.pojo.Instance)1 AbstractHealthChecker (com.alibaba.nacos.api.naming.pojo.healthcheck.AbstractHealthChecker)1 Http (com.alibaba.nacos.api.naming.pojo.healthcheck.impl.Http)1 Secured (com.alibaba.nacos.auth.annotation.Secured)1 Header (com.alibaba.nacos.common.http.param.Header)1 Cluster (com.alibaba.nacos.naming.core.Cluster)1 Service (com.alibaba.nacos.naming.core.Service)1 Client (com.alibaba.nacos.naming.core.v2.client.Client)1