use of com.netflix.loadbalancer.ConfigurationBasedServerList in project ribbon by Netflix.
the class ClientFactoryTest method testChooseServers.
@Test
public void testChooseServers() {
assertNotNull(client);
DynamicServerListLoadBalancer lb = (DynamicServerListLoadBalancer) client.getLoadBalancer();
assertTrue(lb.getServerListImpl() instanceof ConfigurationBasedServerList);
Set<Server> expected = new HashSet<Server>();
expected.add(new Server("www.example1.come:80"));
expected.add(new Server("www.example2.come:80"));
expected.add(new Server("www.example3.come:80"));
Set<Server> result = new HashSet<Server>();
for (int i = 0; i <= 10; i++) {
Server s = lb.chooseServer();
result.add(s);
}
assertEquals(expected, result);
}
Aggregations