Search in sources :

Example 1 with LoadBalancingMetricSupplier

use of com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetricSupplier in project styx by ExpediaGroup.

the class RoundRobinStrategyTest method remoteHostFor.

private static RemoteHost remoteHostFor(String host, int port) {
    Origin origin = newOriginBuilder(host, port).build();
    LoadBalancingMetricSupplier metric = mock(LoadBalancingMetricSupplier.class);
    when(metric.loadBalancingMetric()).thenReturn(new LoadBalancingMetric(45));
    return remoteHost(origin, mock(HttpHandler.class), metric);
}
Also used : Origin(com.hotels.styx.api.extension.Origin) HttpHandler(com.hotels.styx.api.HttpHandler) LoadBalancingMetric(com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetric) LoadBalancingMetricSupplier(com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetricSupplier)

Aggregations

HttpHandler (com.hotels.styx.api.HttpHandler)1 Origin (com.hotels.styx.api.extension.Origin)1 LoadBalancingMetric (com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetric)1 LoadBalancingMetricSupplier (com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetricSupplier)1