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