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