Пример #1
0
  @Test
  public void shouldConvertToModel() {
    User model = sut.toModel(TestDataModels.currentUser(), TestDataDto.user());

    Assert.assertEquals(TestData.USER_ID, model.getId());
    assertEquals(TestData.USER_NAME, model.getUsername());
  }
  @Override
  public void populateEntity(final UserEntity entity, final User model) {
    Assert.notNull(entity, ENTITY_MUST_NOT_BE_NULL);
    Assert.notNull(model, USER_MUST_NOT_BE_NULL);

    entity.setId(model.getId());
    entity.setUsername(model.getUsername());
  }