* If there is an error during serialization.
*/
public static void assertPayloadEquals(final Payload payload, final String expected,
final Class<? extends SingleResourceTransportDto> entityClass) throws IOException {
// Serialize and deserialize to avoid formatting issues
XMLParser xml = new JAXBParser("false");
SingleResourceTransportDto entity = xml.fromXML(expected, entityClass);
String toMatch = xml.toXML(entity, entityClass);
assertEquals(payload.getRawContent(), toMatch);
}