private static final Charset UTF8 = Charset.forName("UTF-8");
@Test
public void testSerialize_XStreamWithPureJavaReflectionProvider() {
XStream xstream = new XStream(new PureJavaReflectionProvider());
XStreamSerializer serializer = new XStreamSerializer(UTF8, xstream, new SerialVersionUIDRevisionResolver());
StubAnnotatedAggregate aggregateRoot = new StubAnnotatedAggregate(UUID.randomUUID());
aggregateRoot.doSomething();
String xml = new String(serializer.serialize(aggregateRoot, byte[].class).getData(), UTF8);
assertNotNull(xml);
StubAnnotatedAggregate unmarshalled = (StubAnnotatedAggregate) serializer.deserialize(
new SimpleSerializedObject<byte[]>(xml.getBytes(UTF8), byte[].class, "ignored", "0"));
validateAggregateCondition(aggregateRoot, unmarshalled);
}