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