use of com.hotels.styx.server.HttpRouter in project styx by ExpediaGroup.
the class RouteHandlerAdapterTest method injectsToPipelineWhenRouteFound.
@Test
public void injectsToPipelineWhenRouteFound() {
HttpHandler pipeline = mock(HttpHandler.class);
when(pipeline.handle(any(LiveHttpRequest.class), any(HttpInterceptor.Context.class))).thenReturn(Eventual.of(respOk));
HttpRouter router = mock(HttpRouter.class);
when(router.route(any(LiveHttpRequest.class), any(HttpInterceptor.Context.class))).thenReturn(Optional.of(pipeline));
LiveHttpResponse response = Mono.from(new RouteHandlerAdapter(router).handle(request, requestContext())).block();
assertThat(response.status(), is(OK));
}
Aggregations