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