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