use of com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetric 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);
}
use of com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetric in project styx by ExpediaGroup.
the class StyxBackendServiceClientFactoryTest method hostClient.
private StyxHostHttpClient hostClient(LiveHttpResponse response) {
StyxHostHttpClient mockClient = mock(StyxHostHttpClient.class);
when(mockClient.sendRequest(any(LiveHttpRequest.class), any(Context.class))).thenReturn(Flux.just(response));
when(mockClient.loadBalancingMetric()).thenReturn(new LoadBalancingMetric(1));
return mockClient;
}
Aggregations