@Test public void setupWhenAuthorTest() { presenter.setup(1L, 10L, "admin", new Date(), "My comment"); verify(view).showActions(true); }
public void setup(final Long changeRequestId, final Long commentId, final String authorId, final Date date, final String text) { this.changeRequestId = changeRequestId; this.commentId = commentId; this.authorId = authorId; this.view.setAuthor(authorId); this.view.setDate(this.dateUtils.format(date)); this.view.setText(text); this.view.showActions(isUserAuthor()); }
CommentItemPresenter { public void setup(final Long changeRequestId, final Long commentId, final String authorId, final Date date, final String text) { this.changeRequestId = changeRequestId; this.commentId = commentId; this.authorId = authorId; this.view.setAuthor(authorId); this.view.setDate(this.dateUtils.format(date)); this.view.setText(text); this.view.showActions(isUserAuthor()); } }
CommentItemPresenter { public void setup(final Long changeRequestId, final Long commentId, final String authorId, final Date date, final String text) { this.changeRequestId = changeRequestId; this.commentId = commentId; this.authorId = authorId; this.view.setAuthor(authorId); this.view.setDate(this.dateUtils.format(date)); this.view.setText(text); this.view.showActions(isUserAuthor()); } @Inject  CommentItemPresenter(final View view,
                                final DateUtils dateUtils,
                                final Caller<ChangeRequestService> changeRequestService,
                                final SessionInfo sessionInfo,
                                final LibraryPlaces libraryPlaces); }
CommentItemPresenter { public void setup(final Long changeRequestId, final Long commentId, final String authorId, final Date date, final String text) { this.changeRequestId = changeRequestId; this.commentId = commentId; this.authorId = authorId; this.view.setAuthor(authorId); this.view.setDate(this.dateUtils.format(date)); this.view.setText(text); this.view.showActions(isUserAuthor()); } @Inject  CommentItemPresenter(final View view,
                                final DateUtils dateUtils,
                                final Caller<ChangeRequestService> changeRequestService,
                                final SessionInfo sessionInfo,
                                final LibraryPlaces libraryPlaces); @PostConstruct void postConstruct(); void setup(final Long changeRequestId,
                      final Long commentId,
                      final String authorId,
                      final Date date,
                      final String text); View getView(); void delete(); }
CommentItemPresenter { public void setup(final Long changeRequestId, final Long commentId, final String authorId, final Date date, final String text) { this.changeRequestId = changeRequestId; this.commentId = commentId; this.authorId = authorId; this.view.setAuthor(authorId); this.view.setDate(this.dateUtils.format(date)); this.view.setText(text); this.view.showActions(isUserAuthor()); } @Inject  CommentItemPresenter(final View view,
                                final DateUtils dateUtils,
                                final Caller<ChangeRequestService> changeRequestService,
                                final SessionInfo sessionInfo,
                                final LibraryPlaces libraryPlaces); @PostConstruct void postConstruct(); void setup(final Long changeRequestId,
                      final Long commentId,
                      final String authorId,
                      final Date date,
                      final String text); View getView(); void delete();  }