use of com.alibaba.nacos.naming.healthcheck.heartbeat.ClientBeatCheckTaskV2 in project nacos by alibaba.
the class HealthCheckTaskInterceptWrapperTest 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(SwitchDomain.class)).thenReturn(switchDomain);
when(applicationContext.getBean(DistroMapper.class)).thenReturn(distroMapper);
when(applicationContext.getBean(UpgradeJudgement.class)).thenReturn(upgradeJudgement);
ApplicationUtils.injectContext(applicationContext);
client = new IpPortBasedClient(CLIENT_ID, true);
when(switchDomain.isHealthCheckEnabled()).thenReturn(true);
when(distroMapper.responsible(client.getResponsibleId())).thenReturn(true);
when(upgradeJudgement.isUseGrpcFeatures()).thenReturn(true);
ClientBeatCheckTaskV2 beatCheckTask = new ClientBeatCheckTaskV2(client);
taskWrapper = new HealthCheckTaskInterceptWrapper(beatCheckTask);
}
use of com.alibaba.nacos.naming.healthcheck.heartbeat.ClientBeatCheckTaskV2 in project nacos by alibaba.
the class IpPortBasedClient method init.
/**
* Init client.
*/
public void init() {
if (ephemeral) {
beatCheckTask = new ClientBeatCheckTaskV2(this);
HealthCheckReactor.scheduleCheck(beatCheckTask);
} else {
healthCheckTaskV2 = new HealthCheckTaskV2(this);
HealthCheckReactor.scheduleCheck(healthCheckTaskV2);
}
}
Aggregations