"methodRP2", true, 2, params);
multiRequests.add(edRequest);
MvcResult result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
List<ExtDirectResponse> responses = ControllerUtil.readDirectResponses(result
.getResponse().getContentAsByteArray());
assertResponse("remoteProviderSimpleNamed", "methodRP2", 2, new ResultObject(
"Olstead", 33, Boolean.FALSE), responses);
params = new LinkedHashMap<String, Object>();
params.put("theAge", "33");
params.put("active", Boolean.FALSE);
edRequest = ControllerUtil.createEdsRequest("remoteProviderSimpleNamed",
"methodRP2", true, 3, params);
multiRequests.add(edRequest);
result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertResponse("remoteProviderSimpleNamed", "methodRP2", 3, new ResultObject(
"myName", 33, Boolean.FALSE), responses);
params = new LinkedHashMap<String, Object>();
params.put("lastName", "Olstead");
params.put("active", Boolean.FALSE);
edRequest = ControllerUtil.createEdsRequest("remoteProviderSimpleNamed",
"methodRP2", true, 4, params);
multiRequests.add(edRequest);
result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertResponse("remoteProviderSimpleNamed", "methodRP2", 4, new ResultObject(
"Olstead", 20, Boolean.FALSE), responses);
params = new LinkedHashMap<String, Object>();
params.put("lastName", "Olstead");
params.put("theAge", 36);
edRequest = ControllerUtil.createEdsRequest("remoteProviderSimpleNamed",
"methodRP2", true, 5, params);
multiRequests.add(edRequest);
result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertResponse("remoteProviderSimpleNamed", "methodRP2", 5, new ResultObject(
"Olstead", 36, Boolean.TRUE), responses);
params = new LinkedHashMap<String, Object>();
params.put("active", Boolean.FALSE);
edRequest = ControllerUtil.createEdsRequest("remoteProviderSimpleNamed",
"methodRP2", true, 6, params);
multiRequests.add(edRequest);
result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertResponse("remoteProviderSimpleNamed", "methodRP2", 6, new ResultObject(
"myName", 20, Boolean.FALSE), responses);
params = new LinkedHashMap<String, Object>();
params.put("lastName", "Miller");
edRequest = ControllerUtil.createEdsRequest("remoteProviderSimpleNamed",
"methodRP2", true, 7, params);
multiRequests.add(edRequest);
result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertResponse("remoteProviderSimpleNamed", "methodRP2", 7, new ResultObject(
"Miller", 20, Boolean.TRUE), responses);
params = new LinkedHashMap<String, Object>();
params.put("theAge", 55);
edRequest = ControllerUtil.createEdsRequest("remoteProviderSimpleNamed",
"methodRP2", true, 8, params);
multiRequests.add(edRequest);
result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertResponse("remoteProviderSimpleNamed", "methodRP2", 8, new ResultObject(
"myName", 55, Boolean.TRUE), responses);
params = new LinkedHashMap<String, Object>();
edRequest = ControllerUtil.createEdsRequest("remoteProviderSimpleNamed",
"methodRP2", true, 9, params);
multiRequests.add(edRequest);
result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertResponse("remoteProviderSimpleNamed", "methodRP2", 9, new ResultObject(
"myName", 20, Boolean.TRUE), responses);
StringBuilder sb = new StringBuilder();
sb.append("[");
for (String requests : multiRequests) {
sb.append(requests);
sb.append(",");
}
sb.replace(sb.length() - 1, sb.length(), "]");
result = ControllerUtil.performRouterRequest(mockMvc, sb.toString());
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertThat(responses).hasSize(8);
assertResponse("remoteProviderSimpleNamed", "methodRP2", 2, new ResultObject(
"Olstead", 33, Boolean.FALSE), responses.subList(0, 1));
assertResponse("remoteProviderSimpleNamed", "methodRP2", 3, new ResultObject(
"myName", 33, Boolean.FALSE), responses.subList(1, 2));
assertResponse("remoteProviderSimpleNamed", "methodRP2", 4, new ResultObject(
"Olstead", 20, Boolean.FALSE), responses.subList(2, 3));
assertResponse("remoteProviderSimpleNamed", "methodRP2", 5, new ResultObject(
"Olstead", 36, Boolean.TRUE), responses.subList(3, 4));
assertResponse("remoteProviderSimpleNamed", "methodRP2", 6, new ResultObject(
"myName", 20, Boolean.FALSE), responses.subList(4, 5));
assertResponse("remoteProviderSimpleNamed", "methodRP2", 7, new ResultObject(
"Miller", 20, Boolean.TRUE), responses.subList(5, 6));
assertResponse("remoteProviderSimpleNamed", "methodRP2", 8, new ResultObject(
"myName", 55, Boolean.TRUE), responses.subList(6, 7));
assertResponse("remoteProviderSimpleNamed", "methodRP2", 9, new ResultObject(
"myName", 20, Boolean.TRUE), responses.subList(7, 8));
}