@Test public void convertTest(){ AddTipsAndTricksCommentDtoResponse expected = ModelUtils.getAddTipsAndTricksCommentDtoResponse(); AddTipsAndTricksCommentDtoResponse actual = mapper.convert(ModelUtils.getTipsAndTricksComment()); assertEquals(expected, actual); }
@Override protected AddTipsAndTricksCommentDtoResponse convert(TipsAndTricksComment tipsAndTricksComment) { User user = tipsAndTricksComment.getUser(); return AddTipsAndTricksCommentDtoResponse.builder() .id(tipsAndTricksComment.getId()) .modifiedDate(tipsAndTricksComment.getModifiedDate()) .text(tipsAndTricksComment.getText()) .author(TipsAndTricksCommentAuthorDto.builder() .id(user.getId()) .name(user.getName()) .userProfilePicturePath(user.getProfilePicturePath()) .build()) .build(); }
AddTipsAndTricksCommentDtoResponseMapper extends AbstractConverter<TipsAndTricksComment, AddTipsAndTricksCommentDtoResponse> { @Override protected AddTipsAndTricksCommentDtoResponse convert(TipsAndTricksComment tipsAndTricksComment) { User user = tipsAndTricksComment.getUser(); return AddTipsAndTricksCommentDtoResponse.builder() .id(tipsAndTricksComment.getId()) .modifiedDate(tipsAndTricksComment.getModifiedDate()) .text(tipsAndTricksComment.getText()) .author(TipsAndTricksCommentAuthorDto.builder() .id(user.getId()) .name(user.getName()) .userProfilePicturePath(user.getProfilePicturePath()) .build()) .build(); } }
AddTipsAndTricksCommentDtoResponseMapper extends AbstractConverter<TipsAndTricksComment, AddTipsAndTricksCommentDtoResponse> { @Override protected AddTipsAndTricksCommentDtoResponse convert(TipsAndTricksComment tipsAndTricksComment) { User user = tipsAndTricksComment.getUser(); return AddTipsAndTricksCommentDtoResponse.builder() .id(tipsAndTricksComment.getId()) .modifiedDate(tipsAndTricksComment.getModifiedDate()) .text(tipsAndTricksComment.getText()) .author(TipsAndTricksCommentAuthorDto.builder() .id(user.getId()) .name(user.getName()) .userProfilePicturePath(user.getProfilePicturePath()) .build()) .build(); }  }
AddTipsAndTricksCommentDtoResponseMapper extends AbstractConverter<TipsAndTricksComment, AddTipsAndTricksCommentDtoResponse> { @Override protected AddTipsAndTricksCommentDtoResponse convert(TipsAndTricksComment tipsAndTricksComment) { User user = tipsAndTricksComment.getUser(); return AddTipsAndTricksCommentDtoResponse.builder() .id(tipsAndTricksComment.getId()) .modifiedDate(tipsAndTricksComment.getModifiedDate()) .text(tipsAndTricksComment.getText()) .author(TipsAndTricksCommentAuthorDto.builder() .id(user.getId()) .name(user.getName()) .userProfilePicturePath(user.getProfilePicturePath()) .build()) .build(); }   }
AddTipsAndTricksCommentDtoResponseMapper extends AbstractConverter<TipsAndTricksComment, AddTipsAndTricksCommentDtoResponse> { @Override protected AddTipsAndTricksCommentDtoResponse convert(TipsAndTricksComment tipsAndTricksComment) { User user = tipsAndTricksComment.getUser(); return AddTipsAndTricksCommentDtoResponse.builder() .id(tipsAndTricksComment.getId()) .modifiedDate(tipsAndTricksComment.getModifiedDate()) .text(tipsAndTricksComment.getText()) .author(TipsAndTricksCommentAuthorDto.builder() .id(user.getId()) .name(user.getName()) .userProfilePicturePath(user.getProfilePicturePath()) .build()) .build(); }    }