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