Package net.csdn.modules.mock

Examples of net.csdn.modules.mock.MockRestRequest


    }


    //单元测试可以调用
    public ApplicationController mockRequest(Map<String, String> params, RestRequest.Method method, String xmlOrJsonData) {
        this.request = new MockRestRequest(params, method, xmlOrJsonData);
        this.restResponse = new MockRestResponse();
        return this;
    }
View Full Code Here


            newParams.put(key, params.get(key).toString());
        }

        RestController controller = injector.getInstance(RestController.class);
        try {
            RestRequest restRequest = new MockRestRequest(path, newParams, method, null);
            HttpServer.setHttpHolder(new HttpHolder(restRequest, response));
            controller.dispatchRequest(restRequest, response);
        } catch (Exception e) {
            catchRenderFinish(e);
        }
View Full Code Here

            }
        }

        RestController controller = injector.getInstance(RestController.class);
        try {
            controller.dispatchRequest(new MockRestRequest(path, newParams, method, rawParamsStr), response);
        } catch (Exception e) {
            catchRenderFinish(e);
        }
        return response;
    }
View Full Code Here

TOP

Related Classes of net.csdn.modules.mock.MockRestRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.