@Test public void findClaim_notFound() { final long claimId = 697L; when(claimRepository.findOne(claimId)).thenReturn(Optional.empty()); final Optional<ClaimDto> result = claimService.findOne(claimId); assertThat(result).isEmpty(); }
@Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository,
                            final ClaimRepository claimRepository,
                            final RequestClaimRepository requestClaimRepository,
                            final GithubClaimResolver githubClaimResolver,
                            final Mappers mappers,
                            final ClaimDtoAggregator claimDtoAggregator,
                            final ApplicationEventPublisher eventPublisher); }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository,
                            final ClaimRepository claimRepository,
                            final RequestClaimRepository requestClaimRepository,
                            final GithubClaimResolver githubClaimResolver,
                            final Mappers mappers,
                            final ClaimDtoAggregator claimDtoAggregator,
                            final ApplicationEventPublisher eventPublisher); @Override @Transactional(readOnly = true) Optional<ClaimDto> findOne(final Long id); @Transactional @Override void claim(Principal user, UserClaimRequest userClaimRequest); @Override @Transactional(readOnly = true) ClaimsByTransactionAggregate getAggregatedClaimsForRequest(final long requestId); @EventListener void onClaimed(final RequestClaimedEvent claimedEvent); }
ClaimServiceImpl implements ClaimService { @Override @Transactional(readOnly = true) public Optional<ClaimDto> findOne(final Long id) { return claimRepository.findOne(id).map(claim -> mappers.map(Claim.class, ClaimDto.class, claim)); } ClaimServiceImpl(final RequestRepository requestRepository,
                            final ClaimRepository claimRepository,
                            final RequestClaimRepository requestClaimRepository,
                            final GithubClaimResolver githubClaimResolver,
                            final Mappers mappers,
                            final ClaimDtoAggregator claimDtoAggregator,
                            final ApplicationEventPublisher eventPublisher); @Override @Transactional(readOnly = true) Optional<ClaimDto> findOne(final Long id); @Transactional @Override void claim(Principal user, UserClaimRequest userClaimRequest); @Override @Transactional(readOnly = true) ClaimsByTransactionAggregate getAggregatedClaimsForRequest(final long requestId); @EventListener void onClaimed(final RequestClaimedEvent claimedEvent);  }