Search in sources :

Example 6 with AbstractHttpServletRequest

use of org.apache.servicecomb.foundation.vertx.http.AbstractHttpServletRequest in project incubator-servicecomb-java-chassis by apache.

the class TestRestProducerInvocation method invokeNormal.

@Test
public void invokeNormal() {
    restProducerInvocation = new MockUp<RestProducerInvocation>() {

        @Mock
        void findRestOperation() {
            restProducerInvocation.restOperationMeta = restOperationMeta;
        }

        @Mock
        void scheduleInvocation() {
            scheduleInvocation = true;
        }
    }.getMockInstance();
    requestEx = new AbstractHttpServletRequest() {
    };
    restProducerInvocation.invoke(transport, requestEx, responseEx, httpServerFilters);
    Assert.assertTrue(scheduleInvocation);
    Assert.assertSame(requestEx, requestEx.getAttribute(RestConst.REST_REQUEST));
}
Also used : AbstractHttpServletRequest(org.apache.servicecomb.foundation.vertx.http.AbstractHttpServletRequest) MockUp(mockit.MockUp) Test(org.junit.Test)

Aggregations

AbstractHttpServletRequest (org.apache.servicecomb.foundation.vertx.http.AbstractHttpServletRequest)6 Test (org.junit.Test)6 Expectations (mockit.Expectations)5 Executor (java.util.concurrent.Executor)3 ReactiveExecutor (org.apache.servicecomb.core.executor.ReactiveExecutor)3 HashMap (java.util.HashMap)2 Holder (javax.xml.ws.Holder)2 MockUp (mockit.MockUp)2 OperationLocator (org.apache.servicecomb.common.rest.locator.OperationLocator)1 ServicePathManager (org.apache.servicecomb.common.rest.locator.ServicePathManager)1 InvocationStartEvent (org.apache.servicecomb.core.event.InvocationStartEvent)1