HonorTypeConverter extends AbstractConverter<HonorType, HonorTypeResource> { @Override public HonorTypeResource convert(final HonorType source, final HonorTypeResource target) { target.setId(source.getId()); target.setName(source.getName()); target.setAbbrName(source.getAbbrName()); return target; }  @Override HonorTypeResource convert(final HonorType source, final HonorTypeResource target); @Override HonorTypeResource convert(final HonorType source);  }
@Test public void testConvert() throws Exception { String name = "first blood"; String abbrName = "fb"; HonorType source = new HonorType(); source.setName(name); source.setAbbrName(abbrName); HonorTypeResource expected = new HonorTypeResource(); expected.setName(name); expected.setAbbrName(abbrName); HonorTypeResource actual = unit.convert(source); assertEquals(expected, actual); }