IScript script = newMock(IScript.class);
IForm form = newForm();
IBinding binding = newMock(IBinding.class);
IEngineService engine = newEngineService();
ILink link = newMock(ILink.class);
Submit submit = newInstance(Submit.class,
"submitType", "cancel",
"submitScript", script, "form", form,
"async", true, "updateComponents", updates,
"directService", engine);
submit.setBinding("onClick", binding);
IRequestCycle cycle = newCycle();
IMarkupWriter writer = newWriter();
expect(engine.getLink(eq(true), isA(DirectServiceParameter.class))).andReturn(link);
expect(link.getURL()).andReturn("/test/url");
PageRenderSupport prs = newPageRenderSupport();
trainGetPageRenderSupport(cycle, prs);