@Test
public void serializeNestedObjects() throws Exception {
serializationState = new FastBlobStateEngine(serializersFactory);
cache("TypeC", new TypeC(
typeAMap(),
Arrays.asList(
new TypeB(3, "four"),
new TypeB(5, "six")
)
));
serializeAndDeserializeSnapshot();
final TypeC deserializedC = (TypeC) getAll("TypeC").get(0);
Assert.assertEquals(2, deserializedC.getTypeAMap().size());
Assert.assertEquals(12, deserializedC.getTypeAMap().get("ED").getVal1());
Assert.assertEquals(34, deserializedC.getTypeAMap().get("ED").getVal2());
Assert.assertEquals(56, deserializedC.getTypeAMap().get("BR").getVal1());
Assert.assertEquals(78, deserializedC.getTypeAMap().get("BR").getVal2());
Assert.assertEquals(2, deserializedC.getTypeBs().size());
Assert.assertEquals(3, deserializedC.getTypeBs().get(0).getVal1());
Assert.assertEquals("four", deserializedC.getTypeBs().get(0).getVal2());
Assert.assertEquals(5, deserializedC.getTypeBs().get(1).getVal1());
Assert.assertEquals("six", deserializedC.getTypeBs().get(1).getVal2());
Assert.assertSame(deserializedC.getTypeAMap(), getAll(TypeCSerializer.MAP_SERIALIZER.getName()).get(0));
Assert.assertSame(deserializedC.getTypeBs(), getAll(TypeCSerializer.LIST_SERIALIZER.getName()).get(0));
Assert.assertTrue(getAll("TypeB").contains(deserializedC.getTypeBs().get(0)));
Assert.assertTrue(getAll("TypeB").contains(deserializedC.getTypeBs().get(1)));
}