use of com.alibaba.nacos.naming.core.v2.client.impl.IpPortBasedClient in project nacos by alibaba.
the class ClientBeatCheckTaskV2Test method setUp.
@Before
public void setUp() throws Exception {
when(applicationContext.getBean(NamingMetadataManager.class)).thenReturn(namingMetadataManager);
when(applicationContext.getBean(GlobalConfig.class)).thenReturn(globalConfig);
when(applicationContext.getBean(DistroMapper.class)).thenReturn(distroMapper);
when(distroMapper.responsible(anyString())).thenReturn(true);
ApplicationUtils.injectContext(applicationContext);
client = new IpPortBasedClient(CLIENT_ID, true);
beatCheckTask = new ClientBeatCheckTaskV2(client);
}
use of com.alibaba.nacos.naming.core.v2.client.impl.IpPortBasedClient in project nacos by alibaba.
the class HealthCheckTaskV2Test method setUp.
@Before
public void setUp() {
ApplicationUtils.injectContext(context);
when(ApplicationUtils.getBean(SwitchDomain.class)).thenReturn(switchDomain);
when(switchDomain.getTcpHealthParams()).thenReturn(new SwitchDomain.TcpHealthParams());
when(ApplicationUtils.getBean(NamingMetadataManager.class)).thenReturn(new NamingMetadataManager());
healthCheckTaskV2 = new HealthCheckTaskV2(ipPortBasedClient);
}
use of com.alibaba.nacos.naming.core.v2.client.impl.IpPortBasedClient 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();
}
use of com.alibaba.nacos.naming.core.v2.client.impl.IpPortBasedClient in project nacos by alibaba.
the class IpPortBasedClientTest method setUp.
@Before
public void setUp() throws Exception {
ipPortBasedClient = new IpPortBasedClient(clientId, true);
ipPortBasedClient.init();
instancePublishInfo = new InstancePublishInfo();
}
Aggregations