CourseTypeConverter extends AbstractConverter<CourseType, CourseTypeResource> { @Override public CourseTypeResource convert(final CourseType source, final CourseTypeResource target) { target.setId(source.getId()); target.setName(source.getName()); target.setAbbrName(source.getAbbrName()); return target; }  @Override CourseTypeResource convert(final CourseType source, final CourseTypeResource target); @Override CourseTypeResource convert(final CourseType source);  }
@Test public void testConvert() throws Exception { String name = "AddressN"; String abbrName = "AN"; CourseType source = new CourseType(); source.setName(name); source.setAbbrName(abbrName); CourseTypeResource expected = new CourseTypeResource(); expected.setName(name); expected.setAbbrName(abbrName); CourseTypeResource actual = unit.convert(source); assertEquals(expected, actual); }