use of com.netflix.loadbalancer.LoadBalancerContext in project ribbon by Netflix.
the class DiscoveryLoadBalancerTest method testLoadBalancer.
@Test
public void testLoadBalancer() {
IClientConfig config = IClientConfig.Builder.newBuilder().withDefaultValues().withDeploymentContextBasedVipAddresses(getVipAddress()).build().set(IClientConfigKey.Keys.NIWSServerListClassName, DiscoveryEnabledNIWSServerList.class.getName());
LoadBalancingHttpClient<ByteBuf, ByteBuf> client = RibbonTransport.newHttpClient(config);
LoadBalancerContext lbContext = client.getLoadBalancerContext();
List<Server> serverList = lbContext.getLoadBalancer().getAllServers();
assertEquals(getMockServerList(), serverList);
}
Aggregations