@Test
public void testBuildRequestWithSingleValueParameters()
{
List<String> lines;
AgiRequest request;
lines = new ArrayList<String>();
lines.add("agi_network_script: myscript.agi?param1=value1¶m2=value2");
lines.add("agi_request: agi://host/myscript.agi?param1=value1¶m2=value2");
request = new AgiRequestImpl(lines);
assertEquals("incorrect script", "myscript.agi", request.getScript());
assertEquals("incorrect requestURL", "agi://host/myscript.agi?param1=value1¶m2=value2", request.getRequestURL());
assertEquals("incorrect value for parameter 'param1'", "value1", request.getParameter("param1"));
assertEquals("incorrect value for parameter 'param2'", "value2", request.getParameter("param2"));
assertEquals("incorrect value for unset parameter 'param3'", null, request.getParameter("param3"));
assertEquals("incorrect size of getParameterMap()", 2, request.getParameterMap().size());
assertEquals("incorrect value for parameter 'param1' when obtained from map", "value1", ((String[]) request
.getParameterMap().get("param1"))[0]);
}