//Setup call beans
HttpCallBean callBean = createComplexCallBean(responseContentType, i);
httpCallBeans.add(callBean);
//Store expected responses
HttpResponseBean responseBean = createExpectedResponse(responseContentType, callBean, i);
expectedResponses.put("Response " + i, responseBean);
}
//Make the calls
int loopCounter = 0;
for(HttpCallBean callBean: httpCallBeans) {
Date time = new Date();
expectedRequestTimes.put("Response " + loopCounter, new Timestamp(time.getTime()));
cougarManager.makeRestCougarHTTPCall(callBean, protocolRequestType);
loopCounter++;
}
//Get actual responses
loopCounter=0;
for (HttpCallBean httpCallBean: httpCallBeans) {
HttpResponseBean responseBean = httpCallBean.getResponseObjectsByEnum(CougarMessageProtocolResponseTypeEnum.REST);
responseBean.setResponseHeaders(null);
actualResponses.put("Response " + loopCounter, responseBean);
loopCounter++;
}
//Set the expected response time
for(Map.Entry<String, HttpResponseBean> entry: expectedResponses.entrySet()){
HttpResponseBean responseBean = entry.getValue();
String keyString = entry.getKey();
Timestamp requestTime = expectedRequestTimes.get(keyString);
responseBean.setRequestTime(requestTime);
responseBean.setResponseTime(requestTime);
}
RestSustainedPostRequestsTestResultBean returnBean = new RestSustainedPostRequestsTestResultBean();
returnBean.setActualResponses(actualResponses);
returnBean.setExpectedResponses(expectedResponses);