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