use of com.alibaba.graphscope.groot.rpc.RoleClients in project GraphScope by alibaba.
the class RoleClientsTest method testRoleClients.
@Test
void testRoleClients() {
Configs configs = Configs.newBuilder().put(CommonConfig.STORE_NODE_COUNT.getKey(), "1").put(CommonConfig.DISCOVERY_MODE.getKey(), "zookeeper").build();
ChannelManager channelManager = new ChannelManager(configs, new MockFactory());
RoleClients<MockRoleClient> clients = new RoleClients<>(channelManager, RoleType.STORE, MockRoleClient::new);
channelManager.start();
assertNotNull(clients.getClient(0));
assertThrows(NodeConnectException.class, () -> clients.getClient(1));
channelManager.stop();
}
Aggregations