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