Search in sources :

Example 1 with ProducerHttpRequestArgMapper

use of io.servicecomb.provider.rest.common.ProducerHttpRequestArgMapper in project java-chassis by ServiceComb.

the class TestHttpRequestParamCreator method testCreateMockParam.

@Test
public void testCreateMockParam() throws Exception {
    ProducerHttpRequestArgMapper lHttpRequestParamCreator = new ProducerHttpRequestArgMapper(0);
    Invocation invocation = Mockito.mock(Invocation.class);
    OperationMeta operationMeta = Mockito.mock(OperationMeta.class);
    Mockito.when(invocation.getOperationMeta()).thenReturn(operationMeta);
    RestOperationMeta swaggerOperation = Mockito.mock(RestOperationMeta.class);
    Mockito.when(operationMeta.getExtData(RestConst.SWAGGER_REST_OPERATION)).thenReturn(swaggerOperation);
    HttpServletRequest lHttpServletRequest = (HttpServletRequest) lHttpRequestParamCreator.createContextArg(invocation);
    Assert.assertNull(lHttpServletRequest.getMethod());
}
Also used : ProducerHttpRequestArgMapper(io.servicecomb.provider.rest.common.ProducerHttpRequestArgMapper) HttpServletRequest(javax.servlet.http.HttpServletRequest) Invocation(io.servicecomb.core.Invocation) RestOperationMeta(io.servicecomb.common.rest.definition.RestOperationMeta) OperationMeta(io.servicecomb.core.definition.OperationMeta) RestOperationMeta(io.servicecomb.common.rest.definition.RestOperationMeta) Test(org.junit.Test)

Aggregations

RestOperationMeta (io.servicecomb.common.rest.definition.RestOperationMeta)1 Invocation (io.servicecomb.core.Invocation)1 OperationMeta (io.servicecomb.core.definition.OperationMeta)1 ProducerHttpRequestArgMapper (io.servicecomb.provider.rest.common.ProducerHttpRequestArgMapper)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 Test (org.junit.Test)1