7778798081828384858687
assertNull(oneB.getId()); } @Test public void testExcludedField_TwoLevel() { TwoB twoB = new TwoB(); twoB.setId(Integer.valueOf("10")); TwoA twoA = mapper.map(twoB, TwoA.class); assertNull(twoA.getId()); assertEquals(Integer.valueOf("10"), twoB.getId()); }
888990919293949596
@Test public void testExcludedField_TwoLevelReverse() { TwoA twoA = newInstance(TwoA.class); twoA.setId(Integer.valueOf("5")); TwoB twoB = mapper.map(twoA, TwoB.class); assertEquals(Integer.valueOf("5"), twoA.getId()); assertNull(twoB.getId()); }
363738394041424344
@Test public void testParentProperty() { TwoA source = newInstance(TwoA.class); source.setId(new Integer(1)); TwoB dest = mapper.map(source, TwoB.class); assertNotNull(dest); assertEquals(new Integer(1), dest.getId()); }