@Test
public void null_format_is_a_noop()
{
String elementName = "span";
MarkupWriter writer = createMarkupWriter();
ComponentResources resources = mockComponentResources();
Format format = new Format()
{
@Override
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
{
return toAppendTo;
}
@Override
public Object parseObject(String source, ParsePosition pos)
{
return null;
}
};
replay();
Output component = new Output();
component.setup(_value, format, elementName, resources);
writer.element("root");
assertFalse(component.beginRender(writer));
writer.end();
verify();
assertEquals(writer.toString(), "<root></root>");
}