ContactTypeConverter extends AbstractConverter<ContactType, ContactTypeResource> { @Override public ContactTypeResource convert(final ContactType source, final ContactTypeResource target) { target.setId(source.getId()); target.setName(source.getName()); target.setAbbrName(source.getAbbrName()); return target; }  @Override ContactTypeResource convert(final ContactType source, final ContactTypeResource target); @Override ContactTypeResource convert(final ContactType source);  }
@Test public void testConvert() throws Exception { String name = "AddressN"; String abbrName = "AN"; ContactType source = new ContactType(); source.setName(name); source.setAbbrName(abbrName); ContactTypeResource expected = new ContactTypeResource(); expected.setName(name); expected.setAbbrName(abbrName); ContactTypeResource actual = unit.convert(source); assertEquals(expected, actual); }