InsertConverter extends AbstractConverter<S, T> { @Override public T convert(final S source, final T target) { target.setCreateDate(new Date()); target.setUpdateDate(new Date()); target.setActual(1); target.setStatus(RowStatus.ACTIVE); return target; }  @Override T convert(final S source, final T target); @Override T convert(final S source);  }
@Test public void testConvert() throws Exception { SpecialtyResource source = new SpecialtyResource(); String groupTitle = "developers"; Group group = new Group(); group.setTitle(groupTitle); String login = "ivanursul"; User user = new User(); user.setLogin(login); unit.convert(source, target); verify(target).setActual(1); verify(target).setStatus(RowStatus.ACTIVE); }
@Test(expected = UnsupportedOperationException.class) public void testConvertWithOneArgument() throws Exception { unit.convert(null); }