agent.waitForComplete(Collections.singleton(requestId));
checkExpectedOutputParameters(responseCallback, expectedOutputParams);
}
public void testMultipleCall() throws Exception {
final MediaAgent agent = new DefaultMediaAgent(
new ResourceDescriptorStoreStub(), "http://example.com/");
final RequestStub request = new RequestStub();
request.addInputParameter("external-id", "1234-5678-90");
request.addOutputParameterName("outputParamName1");
final ResponseCallbackStub responseCallback =
new ResponseCallbackStub();
final AgentRequestId requestId =
agent.requestURL(request, responseCallback);
Parameters outputParams = responseCallback.getParameters();
assertFalse(outputParams.getParameterNames().hasNext());
final Map expectedOutputParams = new HashMap();
expectedOutputParams.put(
"outputParamName1", "value-of-outputParamName1");
expectedOutputParams.put(
MediaAgent.OUTPUT_URL_PARAMETER_NAME,
"http://example.com/" + "1234-5678-90");
expectedOutputParams.put(
"an-extra-output-parameter", "value-of-the-extra-param");
agent.waitForComplete(requestId);
checkExpectedOutputParameters(responseCallback, expectedOutputParams);
responseCallback.failOnExecute(true);
agent.waitForComplete(requestId);
}