throws IOException
{
IPage page = newMock(IPage.class);
checkOrder(page, false);
IRequestCycle cycle = newMock(IRequestCycle.class);
Infrastructure infra = newMock(Infrastructure.class);
IMarkupWriter writer = newBufferWriter();
NestedMarkupWriter nwriter = newNestedWriter();
ILink link = newMock(ILink.class);
Location l = newLocation();
RequestLocaleManager rlm = newMock(RequestLocaleManager.class);
MarkupWriterSource mrs = newMock(MarkupWriterSource.class);
WebResponse resp = newMock(WebResponse.class);
AssetFactory assetFactory = newMock(AssetFactory.class);
IEngineService pageService = newEngineService();
List errorPages = new ArrayList();
List parts = new ArrayList();
parts.add("id1");
DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, rlm, mrs, resp, errorPages, assetFactory, "", pageService);
PrintWriter pw = newPrintWriter();
rlm.persistLocale();
expect(cycle.getInfrastructure()).andReturn(infra).anyTimes();
expect(infra.getOutputEncoding()).andReturn(("UTF-8")).anyTimes();
expect(cycle.getParameters("updateParts")).andReturn((String[])parts.toArray(new String[parts.size()]));
expect(resp.getPrintWriter(isA(ContentType.class))).andReturn(pw);
expect(mrs.newMarkupWriter(eq(pw), isA(ContentType.class))).andReturn(writer);
expect(cycle.getPage()).andReturn(page);