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