@Test public void findAllRefundRequestsForRequestIdAndStatus() { final long requestId = 3389L; final RefundRequestStatus status = PENDING; final List<RefundRequest> refundRequests = new ArrayList<>(); final ArrayList<RefundRequestDto> refundRequestDtos = new ArrayList<>(); when(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, status)).thenReturn(refundRequests); when(refundRequestDtoMapper.mapToList(same(refundRequests))).thenReturn(refundRequestDtos); final List<RefundRequestDto> result = refundService.findAllRefundRequestsFor(requestId, status); assertThat(result).isSameAs(refundRequestDtos); }
@Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses)); }
RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses)); } }
RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses)); } RefundServiceImpl(final RefundRequestRepository refundRequestRepository,
                             final RefundRepository refundRepository,
                             final RefundRequestDtoMapper refundRequestDtoMapper,
                             final CacheManager cacheManager,
                             final ApplicationEventPublisher applicationEventPublisher); }
RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses)); } RefundServiceImpl(final RefundRequestRepository refundRequestRepository,
                             final RefundRepository refundRepository,
                             final RefundRequestDtoMapper refundRequestDtoMapper,
                             final CacheManager cacheManager,
                             final ApplicationEventPublisher applicationEventPublisher); @Override @Transactional void requestRefund(final RequestRefundCommand requestRefundCommand); @Override @Transactional(readOnly = true) List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses); @Override @Transactional(readOnly = true) List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final String funderAddress, final RefundRequestStatus status); @Override @Transactional void refundProcessed(final RefundProcessedCommand command); }
RefundServiceImpl implements RefundService { @Override @Transactional(readOnly = true) public List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses) { return refundRequestDtoMapper.mapToList(refundRequestRepository.findAllByRequestIdAndStatusIn(requestId, statuses)); } RefundServiceImpl(final RefundRequestRepository refundRequestRepository,
                             final RefundRepository refundRepository,
                             final RefundRequestDtoMapper refundRequestDtoMapper,
                             final CacheManager cacheManager,
                             final ApplicationEventPublisher applicationEventPublisher); @Override @Transactional void requestRefund(final RequestRefundCommand requestRefundCommand); @Override @Transactional(readOnly = true) List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final RefundRequestStatus... statuses); @Override @Transactional(readOnly = true) List<RefundRequestDto> findAllRefundRequestsFor(final long requestId, final String funderAddress, final RefundRequestStatus status); @Override @Transactional void refundProcessed(final RefundProcessedCommand command);  }