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);
builder.setWriter(writer);
expect(page.getPageName()).andReturn("RequestPage").anyTimes();
expect(cycle.getParameter(ServiceConstants.PAGE)).andReturn("anotherPage").anyTimes();
expect(writer.getNestedWriter()).andReturn(nwriter);
nwriter.begin("response");
nwriter.attribute("type", ResponseBuilder.PAGE_TYPE);
expect(pageService.getLink(true, "RequestPage")).andReturn(link);
expect(link.getAbsoluteURL()).andReturn("/new/url");
nwriter.attribute("url", "/new/url");
replay();