EntityDetailsConverter extends AbstractConverter<ENTITY, RESOURCE> { @Override public RESOURCE convert(final ENTITY source, final RESOURCE target) { target.setCreateDate(source.getCreateDate()); target.setCrtUser(source.getCrtUser()); target.setCrtUserGroup(source.getCrtUserGroup()); target.setNote(source.getNote()); target.setUapp(source.getUapp()); target.setUid(source.getUid()); target.setUpdateDate(source.getUpdateDate()); target.setUtid(source.getUtid()); return target; }  @Override RESOURCE convert(final ENTITY source, final RESOURCE target); @Override RESOURCE convert(final ENTITY source);  }
@Test public void testConvert() throws Exception { String utid = "utid"; String note = "sss"; Person source = new Person(); source.setUtid(utid); source.setNote(note); PersonResource target = new PersonResource(); PersonResource expected = new PersonResource(); expected.setNote(note); expected.setUtid(utid); unit.convert(source, target); assertEquals(expected, target); }
@Test(expected = UnsupportedOperationException.class) public void testConvertWithOneArgument() throws Exception { unit.convert(null); }