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