FamilyTypeResourceConverter extends AbstractConverter<FamilyTypeResource, FamilyType> { @Override public FamilyType convert(final FamilyTypeResource source, final FamilyType target) { target.setName(source.getName()); target.setAbbrName(source.getAbbrName()); return target; }  @Override FamilyType convert(final FamilyTypeResource source, final FamilyType target); @Override FamilyType convert(final FamilyTypeResource source);  }
@Test public void testConvert() throws Exception { Long id = 1L; String name = "name"; String abbrName = "abbrName"; FamilyTypeResource source = new FamilyTypeResource(); source.setAbbrName(abbrName); source.setName(name); source.setId(id); FamilyType expected = new FamilyType(); expected.setAbbrName(abbrName); expected.setName(name); FamilyType actual = unit.convert(source); assertEquals(expected, actual); }