mockControl.reset();
}
private void setupRequest(String pathInfo, String actualMethod, String overrideMethod)
throws IOException {
FakeHttpServletRequest fakeReq = new FakeHttpServletRequest("/social/rest", pathInfo, "");
fakeReq.setPathInfo(pathInfo);
fakeReq.setParameter(DataServiceServlet.X_HTTP_METHOD_OVERRIDE, overrideMethod);
fakeReq.setCharacterEncoding("UTF-8");
if (!("GET").equals(actualMethod) && !("HEAD").equals(actualMethod)) {
fakeReq.setPostData("", "UTF-8");
}
fakeReq.setMethod(actualMethod);
fakeReq.setAttribute(AuthInfo.Attribute.SECURITY_TOKEN.getId(), FAKE_GADGET_TOKEN);
fakeReq.setContentType(ContentTypes.OUTPUT_JSON_CONTENT_TYPE);
req = fakeReq;
}