public class Jaxb2MarshallingTests extends AbstractStaxEventWriterItemWriterTests {
@Override
protected Marshaller getMarshaller() throws Exception {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setClassesToBeBound(new Class<?>[] { Trade.class });
marshaller.afterPropertiesSet();
StringWriter string = new StringWriter();
marshaller.marshal(new Trade("FOO", 100, BigDecimal.valueOf(10.), "bar"), new StreamResult(string));
String content = string.toString();
assertTrue("Wrong content: "+content, content.contains("<customer>bar</customer>"));
return marshaller;
}