use of org.apache.servicecomb.foundation.vertx.http.VertxServerRequestToHttpServletRequest in project incubator-servicecomb-java-chassis by apache.
the class VertxRestDispatcher method onRequest.
private void onRequest(RoutingContext context) {
if (transport == null) {
transport = CseContext.getInstance().getTransportManager().findTransport(Const.RESTFUL);
}
HttpServletRequestEx requestEx = new VertxServerRequestToHttpServletRequest(context);
HttpServletResponseEx responseEx = new VertxServerResponseToHttpServletResponse(context.response());
RestProducerInvocation restProducerInvocation = new RestProducerInvocation();
context.put(RestConst.REST_PRODUCER_INVOCATION, restProducerInvocation);
restProducerInvocation.invoke(transport, requestEx, responseEx, httpServerFilters);
}
use of org.apache.servicecomb.foundation.vertx.http.VertxServerRequestToHttpServletRequest in project incubator-servicecomb-java-chassis by apache.
the class TestHttpServerRequestUtils method VertxServerRequestToHttpServletRequest.
@Test
public void VertxServerRequestToHttpServletRequest(@Mocked RoutingContext context, @Mocked HttpServerRequest request) {
HttpServerRequestWrapper wrapper = new HttpServerRequestWrapper(request);
new Expectations() {
{
context.request();
result = wrapper;
}
};
VertxServerRequestToHttpServletRequest reqEx = new VertxServerRequestToHttpServletRequest(context, "abc");
Assert.assertEquals("abc", reqEx.getRequestURI());
}
use of org.apache.servicecomb.foundation.vertx.http.VertxServerRequestToHttpServletRequest in project incubator-servicecomb-java-chassis by apache.
the class EdgeInvocation method init.
public void init(String microserviceName, RoutingContext context, String path, List<HttpServerFilter> httpServerFilters) {
this.microserviceName = microserviceName;
this.requestEx = new VertxServerRequestToHttpServletRequest(context, path);
this.responseEx = new VertxServerResponseToHttpServletResponse(context.response());
this.httpServerFilters = httpServerFilters;
requestEx.setAttribute(RestConst.REST_REQUEST, requestEx);
}
Aggregations