use of com.github.tomakehurst.wiremock.http.RequestHandler in project styx by ExpediaGroup.
the class MockOriginServer method newHandler.
private static HttpHandler newHandler(RequestHandler wireMockHandler) {
return (httpRequest, ctx) -> httpRequest.aggregate(MAX_CONTENT_LENGTH).map(fullRequest -> {
LOGGER.info("Received: {}\n{}", new Object[] { fullRequest.url(), fullRequest.body() });
return fullRequest;
}).flatMap(fullRequest -> {
Request wmRequest = new WiremockStyxRequestAdapter(fullRequest);
com.github.tomakehurst.wiremock.http.Response wmResponse = wireMockHandler.handle(wmRequest);
return Eventual.of(toStyxResponse(wmResponse).stream());
});
}
use of com.github.tomakehurst.wiremock.http.RequestHandler in project styx by ExpediaGroup.
the class MockOriginServer method newHandler.
private static HttpHandler newHandler(String originId, RequestHandler wireMockHandler) {
return (httpRequest, ctx) -> httpRequest.aggregate(MAX_CONTENT_LENGTH).map(fullRequest -> {
LOGGER.info("{} received: {}\n{}", new Object[] { originId, fullRequest.url(), fullRequest.body() });
return fullRequest;
}).flatMap(fullRequest -> {
Request wmRequest = new WiremockStyxRequestAdapter(fullRequest);
com.github.tomakehurst.wiremock.http.Response wmResponse = wireMockHandler.handle(wmRequest);
return Eventual.of(toStyxResponse(wmResponse).stream());
});
}
Aggregations