public TestingDynamoHttpServletRequest createDynamoHttpServletRequest(Map<String, ?> pParameters,
int pBufferSize,
String pMethod,
String pSessionId) {
GenericHttpServletRequest greq = createGenericHttpServletRequest(pSessionId);
String strQuery = createQueryString(pParameters);
// all the following with greq mostly to get parameters parsed
greq.setMethod("GET"); // do that query params will get parsed
if (strQuery == null) {
greq.setRequestURI("/"); // just to avoid NPE
}
else {
greq.setRequestURI("/" + strQuery);
}
greq.getParameter("foo"); // so parameters will be parsed and stick
greq.setMethod(pMethod); // set real method
DynamoHttpServletRequest request = new DynamoHttpServletRequest();
request.setRequest(greq);
ByteBuffer buffer = ByteBuffer.allocate(pBufferSize);
request.setMethod(pMethod);