@Test public void map_null() { final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); when(delegate.map(requestDto)).thenReturn(null); final RequestDetailsView result = decorator.map(requestDto); assertThat(result).isNull(); }
@Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); view.setOwner(issueInfo.getOwner()); view.setRepo(issueInfo.getRepo()); view.setIssueNumber(issueInfo.getNumber()); view.setTitle(issueInfo.getTitle()); view.setStarred(r.isLoggedInUserIsWatcher()); view.setDescription(githubGateway.getIssue(issueInfo.getOwner(), issueInfo.getRepo(), issueInfo.getNumber()).getBodyHtml()); view.setPhase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())); view.setStatus(enumToCapitalizedStringMapper.map(r.getStatus())); } return view; }
RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); view.setOwner(issueInfo.getOwner()); view.setRepo(issueInfo.getRepo()); view.setIssueNumber(issueInfo.getNumber()); view.setTitle(issueInfo.getTitle()); view.setStarred(r.isLoggedInUserIsWatcher()); view.setDescription(githubGateway.getIssue(issueInfo.getOwner(), issueInfo.getRepo(), issueInfo.getNumber()).getBodyHtml()); view.setPhase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())); view.setStatus(enumToCapitalizedStringMapper.map(r.getStatus())); } return view; } }
RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); view.setOwner(issueInfo.getOwner()); view.setRepo(issueInfo.getRepo()); view.setIssueNumber(issueInfo.getNumber()); view.setTitle(issueInfo.getTitle()); view.setStarred(r.isLoggedInUserIsWatcher()); view.setDescription(githubGateway.getIssue(issueInfo.getOwner(), issueInfo.getRepo(), issueInfo.getNumber()).getBodyHtml()); view.setPhase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())); view.setStatus(enumToCapitalizedStringMapper.map(r.getStatus())); } return view; }  }
RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); view.setOwner(issueInfo.getOwner()); view.setRepo(issueInfo.getRepo()); view.setIssueNumber(issueInfo.getNumber()); view.setTitle(issueInfo.getTitle()); view.setStarred(r.isLoggedInUserIsWatcher()); view.setDescription(githubGateway.getIssue(issueInfo.getOwner(), issueInfo.getRepo(), issueInfo.getNumber()).getBodyHtml()); view.setPhase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())); view.setStatus(enumToCapitalizedStringMapper.map(r.getStatus())); } return view; }  @Override RequestDetailsView map(RequestDto r); }
RequestDetailsViewMapperDecorator implements RequestDetailsViewMapper { @Override public RequestDetailsView map(RequestDto r) { RequestDetailsView view = delegate.map(r); if (view != null) { IssueInformationDto issueInfo = r.getIssueInformation(); view.setIcon("https: view.setPlatform(issueInfo.getPlatform().name()); view.setOwner(issueInfo.getOwner()); view.setRepo(issueInfo.getRepo()); view.setIssueNumber(issueInfo.getNumber()); view.setTitle(issueInfo.getTitle()); view.setStarred(r.isLoggedInUserIsWatcher()); view.setDescription(githubGateway.getIssue(issueInfo.getOwner(), issueInfo.getRepo(), issueInfo.getNumber()).getBodyHtml()); view.setPhase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())); view.setStatus(enumToCapitalizedStringMapper.map(r.getStatus())); } return view; }  @Override RequestDetailsView map(RequestDto r);  }