Search in sources :

Example 1 with StyxHostHttpClient

use of com.hotels.styx.client.StyxHostHttpClient 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;
}
Also used : Support.requestContext(com.hotels.styx.support.Support.requestContext) Context(com.hotels.styx.api.HttpInterceptor.Context) LiveHttpRequest(com.hotels.styx.api.LiveHttpRequest) StyxHostHttpClient(com.hotels.styx.client.StyxHostHttpClient) LoadBalancingMetric(com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetric)

Aggregations

Context (com.hotels.styx.api.HttpInterceptor.Context)1 LiveHttpRequest (com.hotels.styx.api.LiveHttpRequest)1 LoadBalancingMetric (com.hotels.styx.api.extension.loadbalancing.spi.LoadBalancingMetric)1 StyxHostHttpClient (com.hotels.styx.client.StyxHostHttpClient)1 Support.requestContext (com.hotels.styx.support.Support.requestContext)1