Search in sources :

Example 1 with HttpResponseWriterFactory

use of com.hotels.styx.server.netty.connectors.HttpPipelineHandler.HttpResponseWriterFactory in project styx by ExpediaGroup.

the class HttpPipelineHandlerTest method responseWriterFactory.

private static HttpResponseWriterFactory responseWriterFactory(CompletableFuture<Void> future) {
    HttpResponseWriterFactory writerFactory = mock(HttpResponseWriterFactory.class);
    HttpResponseWriter responseWriter = mock(HttpResponseWriter.class);
    when(writerFactory.create(any(ChannelHandlerContext.class))).thenReturn(responseWriter);
    when(responseWriter.write(any(LiveHttpResponse.class))).thenReturn(future);
    return writerFactory;
}
Also used : ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) LiveHttpResponse(com.hotels.styx.api.LiveHttpResponse) HttpResponseWriterFactory(com.hotels.styx.server.netty.connectors.HttpPipelineHandler.HttpResponseWriterFactory)

Aggregations

LiveHttpResponse (com.hotels.styx.api.LiveHttpResponse)1 HttpResponseWriterFactory (com.hotels.styx.server.netty.connectors.HttpPipelineHandler.HttpResponseWriterFactory)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1