ConcreteElementDetails elementDetails = new ConcreteElementDetails();
elementDetails.setElementName("the tag name");
elementDetails.setId("the id");
elementDetails.setStyles(StylesBuilder.getEmptyStyles());
ConcreteMenuIcon icon = new ConcreteMenuIcon(elementDetails);
ImageAssetReference imageRef =
new TestNormalImageAssetReference("the normal url");
icon.setNormalURL(imageRef);
ConcreteMenuItem item = new ConcreteMenuItem(
new ElementDetailsStub(), new ConcreteMenuLabel(
new ElementDetailsStub(), createMenuText(),
icon));
// Create the renderer we are to test.
MenuItemComponentRenderer renderer = createImageMenuItemRenderer(
new TestDeprecatedImageOutput(), false);
// Do a render.
String actual = getRenderOutputAsString(renderer, item);
//System.out.println(actual);
// Assemble the expected value (rendered menu item).
String expected =
"<test-image " +
"src=\"" + imageRef.getURL() + "\" " +
"id=\"the id\"" + " " +
// "style-class=\"the style class\"" + " " +
"tag-name=\"the tag name\"" +
"/>";
expected = DOMUtilities.provideDOMNormalizedString(expected);