Search in sources :

Example 6 with RestServerRequestInternal

use of io.servicecomb.common.rest.codec.RestServerRequestInternal in project java-chassis by ServiceComb.

the class VertxRestServer method onRequest.

private void onRequest(RoutingContext context) {
    RestServerRequestInternal restRequest = new RestVertxHttpRequest(context, Future.future());
    context.put(REST_REQUEST, restRequest);
    handleRequest(restRequest, context.response());
}
Also used : RestServerRequestInternal(io.servicecomb.common.rest.codec.RestServerRequestInternal)

Example 7 with RestServerRequestInternal

use of io.servicecomb.common.rest.codec.RestServerRequestInternal in project java-chassis by ServiceComb.

the class TestVertxRestServer method setUp.

@Before
public void setUp() throws Exception {
    Router mainRouter = Router.router(null);
    mainRouter.route().handler(BodyHandler.create());
    instance = new VertxRestServer(mainRouter) {

        @Override
        protected RestOperationMeta findRestOperation(RestServerRequestInternal restRequest) {
            return super.findRestOperation(restRequest);
        }

        @Override
        public void sendFailResponse(RestServerRequestInternal restRequest, HttpServerResponse httpResponse, Throwable throwable) {
        }
    };
}
Also used : RestOperationMeta(io.servicecomb.common.rest.definition.RestOperationMeta) RestServerRequestInternal(io.servicecomb.common.rest.codec.RestServerRequestInternal) HttpServerResponse(io.vertx.core.http.HttpServerResponse) Router(io.vertx.ext.web.Router) Before(org.junit.Before)

Aggregations

RestServerRequestInternal (io.servicecomb.common.rest.codec.RestServerRequestInternal)7 RestOperationMeta (io.servicecomb.common.rest.definition.RestOperationMeta)2 Invocation (io.servicecomb.core.Invocation)2 Test (org.junit.Test)2 OperationMeta (io.servicecomb.core.definition.OperationMeta)1 HttpServerResponse (io.vertx.core.http.HttpServerResponse)1 Router (io.vertx.ext.web.Router)1 Executor (java.util.concurrent.Executor)1 AsyncContext (javax.servlet.AsyncContext)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 MockUp (mockit.MockUp)1 Before (org.junit.Before)1