@Test public void maps() { final String login = "davyvanroy"; final String userUrl = "fxghcgjv"; final String userAvatarUrl = "fgjhkj"; when(delegate.map(any())).thenReturn(CommentDto.builder().build()); final CommentDto result = decorator.map(GithubIssueCommentsResult.builder() .user(GithubUser.builder() .login(login) .url(userUrl) .avatarUrl(userAvatarUrl) .build()) .build()); assertThat(result.getUserName()).isEqualTo(login); assertThat(result.getUserUrl()).isEqualTo(userUrl); assertThat(result.getUserAvatar()).isEqualTo(userAvatarUrl); }
@Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()); } return comment; }
CommentDtoMapperDecorator implements CommentDtoMapper { @Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()); } return comment; } }
CommentDtoMapperDecorator implements CommentDtoMapper { @Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()); } return comment; }  }
CommentDtoMapperDecorator implements CommentDtoMapper { @Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()); } return comment; }  @Override CommentDto map(GithubIssueCommentsResult in); }
CommentDtoMapperDecorator implements CommentDtoMapper { @Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()); } return comment; }  @Override CommentDto map(GithubIssueCommentsResult in);  }