assertEquals(testDataFactory.getExpectedTestHydrateAndMoreDehydrateTestObject(), dhto);
}
@Test
public void testDeepProperties() throws Exception {
House src = testDataFactory.getHouse();
HomeDescription dest = mapper.map(src, HomeDescription.class);
House src2 = mapper.map(dest, House.class);
HomeDescription dest2 = mapper.map(src2, HomeDescription.class);
long[] prim = { 1, 2, 3, 1, 2, 3 };
// cumulative relationship
dest.setPrim(prim);
assertEquals(dest, dest2);
// By reference
src = testDataFactory.getHouse();
House houseClone = (House) SerializationUtils.clone(src);
dest = mapper.map(src, HomeDescription.class);
mapper.map(dest, src);
// cumulative relationship
int[] prims = { 1, 2, 3, 1, 2, 3 };
houseClone.getOwner().setPrim(prims);
// add two more rooms
Room room1 = new Room();
room1.setName("Living");
Room room2 = new Room();
room2.setName("kitchen");
Van van = new Van();
van.setName("van2");
houseClone.getRooms().add(room1);
houseClone.getRooms().add(room2);
houseClone.getCustomSetGetMethod().add(van);
assertEquals(houseClone, src);
}