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