@Test void findBy_noGithubIssueFound() { final String platformId = "dfsfd|FR|wfgwar|FR|243"; when(githubIssueService.findBy(platformId)).thenReturn(Optional.empty()); final Optional<PlatformIssueDto> result = platformIssueService.findBy(Platform.GITHUB, platformId); assertThat(result).isEmpty(); }
@Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, githubIssue)); } return Optional.empty(); }
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, githubIssue)); } return Optional.empty(); } }
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, githubIssue)); } return Optional.empty(); } PlatformIssueServiceImpl(final GithubIssueService githubIssueService, final Mappers mappers); }
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, githubIssue)); } return Optional.empty(); } PlatformIssueServiceImpl(final GithubIssueService githubIssueService, final Mappers mappers); @Override Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId); }
PlatformIssueServiceImpl implements PlatformIssueService { @Override public Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId) { if (Platform.GITHUB == platform) { return githubIssueService.findBy(platformId) .map(githubIssue -> mappers.map(GithubIssue.class, PlatformIssueDto.class, githubIssue)); } return Optional.empty(); } PlatformIssueServiceImpl(final GithubIssueService githubIssueService, final Mappers mappers); @Override Optional<PlatformIssueDto> findBy(final Platform platform, final String platformId);  }