@Test public void map() { final String status = "szfgdhxf"; final String phase = "sgzdxhfc"; final RequestDto request = RequestDtoMother.fundRequestArea51(); when(enumToCapitalizedStringMapper.map(request.getStatus())).thenReturn(status); when(enumToCapitalizedStringMapper.map(request.getStatus().getPhase())).thenReturn(phase); final RequestView result = mapper.map(request); assertThat(result.getId()).isEqualTo(request.getId()); assertThat(result.getIcon()).isEqualTo("https: assertThat(result.getOwner()).isEqualTo(request.getIssueInformation().getOwner()); assertThat(result.getRepo()).isEqualTo(request.getIssueInformation().getRepo()); assertThat(result.getIssueNumber()).isEqualTo(request.getIssueInformation().getNumber()); assertThat(result.getPlatform()).isEqualTo(request.getIssueInformation().getPlatform().name()); assertThat(result.getTitle()).isEqualTo(request.getIssueInformation().getTitle()); assertThat(result.getStatus()).isEqualTo(status); assertThat(result.getPhase()).isEqualTo(phase); assertThat(result.getStarred()).isEqualTo(request.isLoggedInUserIsWatcher()); assertThat(result.getTechnologies()).isEqualTo(request.getTechnologies()); assertThat(result.getFunds()).isEqualTo(request.getFunds()); assertThat(result.getCreationDate()).isEqualTo(request.getCreationDate()); assertThat(result.getLastModifiedDate()).isEqualTo(request.getLastModifiedDate()); }
@Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueInformation().getNumber()) .platform(r.getIssueInformation().getPlatform().name()) .title(r.getIssueInformation().getTitle()) .status(enumToCapitalizedStringMapper.map(r.getStatus())) .phase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())) .starred(r.isLoggedInUserIsWatcher()) .technologies(r.getTechnologies()) .funds(r.getFunds()) .creationDate(r.getCreationDate() != null ? r.getCreationDate().atZone(ZoneId.systemDefault()) : null) .lastModifiedDate(r.getLastModifiedDate() != null ? r.getLastModifiedDate().atZone(ZoneId.systemDefault()) : null) .build(); }
RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueInformation().getNumber()) .platform(r.getIssueInformation().getPlatform().name()) .title(r.getIssueInformation().getTitle()) .status(enumToCapitalizedStringMapper.map(r.getStatus())) .phase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())) .starred(r.isLoggedInUserIsWatcher()) .technologies(r.getTechnologies()) .funds(r.getFunds()) .creationDate(r.getCreationDate() != null ? r.getCreationDate().atZone(ZoneId.systemDefault()) : null) .lastModifiedDate(r.getLastModifiedDate() != null ? r.getLastModifiedDate().atZone(ZoneId.systemDefault()) : null) .build(); } }
RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueInformation().getNumber()) .platform(r.getIssueInformation().getPlatform().name()) .title(r.getIssueInformation().getTitle()) .status(enumToCapitalizedStringMapper.map(r.getStatus())) .phase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())) .starred(r.isLoggedInUserIsWatcher()) .technologies(r.getTechnologies()) .funds(r.getFunds()) .creationDate(r.getCreationDate() != null ? r.getCreationDate().atZone(ZoneId.systemDefault()) : null) .lastModifiedDate(r.getLastModifiedDate() != null ? r.getLastModifiedDate().atZone(ZoneId.systemDefault()) : null) .build(); } RequestViewMapper(final EnumToCapitalizedStringMapper enumToCapitalizedStringMapper); }
RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueInformation().getNumber()) .platform(r.getIssueInformation().getPlatform().name()) .title(r.getIssueInformation().getTitle()) .status(enumToCapitalizedStringMapper.map(r.getStatus())) .phase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())) .starred(r.isLoggedInUserIsWatcher()) .technologies(r.getTechnologies()) .funds(r.getFunds()) .creationDate(r.getCreationDate() != null ? r.getCreationDate().atZone(ZoneId.systemDefault()) : null) .lastModifiedDate(r.getLastModifiedDate() != null ? r.getLastModifiedDate().atZone(ZoneId.systemDefault()) : null) .build(); } RequestViewMapper(final EnumToCapitalizedStringMapper enumToCapitalizedStringMapper); @Override RequestView map(final RequestDto r); }
RequestViewMapper implements BaseMapper<RequestDto, RequestView> { @Override public RequestView map(final RequestDto r) { if (r == null) { return null; } return RequestView.builder() .id(r.getId()) .icon("https: .owner(r.getIssueInformation().getOwner()) .repo(r.getIssueInformation().getRepo()) .issueNumber(r.getIssueInformation().getNumber()) .platform(r.getIssueInformation().getPlatform().name()) .title(r.getIssueInformation().getTitle()) .status(enumToCapitalizedStringMapper.map(r.getStatus())) .phase(enumToCapitalizedStringMapper.map(r.getStatus().getPhase())) .starred(r.isLoggedInUserIsWatcher()) .technologies(r.getTechnologies()) .funds(r.getFunds()) .creationDate(r.getCreationDate() != null ? r.getCreationDate().atZone(ZoneId.systemDefault()) : null) .lastModifiedDate(r.getLastModifiedDate() != null ? r.getLastModifiedDate().atZone(ZoneId.systemDefault()) : null) .build(); } RequestViewMapper(final EnumToCapitalizedStringMapper enumToCapitalizedStringMapper); @Override RequestView map(final RequestDto r);  }