public final void pageEmbeddingChainsToEmbeddedWidget(String pageName, final String passOn, final String expression) throws ExpressionCompileException {
//forName expects pageName to be in all-lower case (it's an optimization)
pageName = pageName.toLowerCase();
final PageBook pageBook = createMock(PageBook.class);
final PageBook.Page page = createMock(PageBook.Page.class);
final Respond respond = RespondersForTesting.newRespond();
final MvelEvaluator evaluator = new MvelEvaluator();
final WidgetChain widget = new ProceedingWidgetChain();
final WidgetChain targetWidgetChain = new ProceedingWidgetChain();
//noinspection unchecked
targetWidgetChain.addWidget(new XmlWidget(new TerminalWidgetChain(), "p", new MvelEvaluatorCompiler(Object.class),
new LinkedHashMap<String, String>() {{
put("class", "pretty");
put("id", "a-p-tag");
}}));
widget.addWidget(new ShowIfWidget(targetWidgetChain, "true", evaluator));
Renderable bodyWrapper = new XmlWidget(widget, "body", createMock(EvaluatorCompiler.class), Collections.<String, String>emptyMap());
expect(pageBook.forName(pageName))
.andReturn(page);
//mypage does?
final MyEmbeddedPage myEmbeddedPage = new MyEmbeddedPage();