@Test public void shouldGetReplenishmentDTOByRequisitionId() throws Exception { Long rnrId = 3L; Rnr expectedRnr = new Rnr(rnrId); mockStatic(ReplenishmentDTO.class); Order order = mock(Order.class); when(requisitionService.getFullRequisitionById(rnrId)).thenReturn(expectedRnr); when(orderService.getOrder(rnrId)).thenReturn(order); ReplenishmentDTO expectedReplenishmentDTO = new ReplenishmentDTO(); when(ReplenishmentDTO.prepareForREST(expectedRnr, order)).thenReturn(expectedReplenishmentDTO); ReplenishmentDTO replenishmentDTO = service.getReplenishmentDetails(rnrId); assertThat(replenishmentDTO, is(expectedReplenishmentDTO)); verify(requisitionService).getFullRequisitionById(rnrId); }
public ReplenishmentDTO getReplenishmentDetails(Long id) { Rnr requisition = requisitionService.getFullRequisitionById(id); return prepareForREST(requisition, orderService.getOrder(id)); }
RestRequisitionService { public ReplenishmentDTO getReplenishmentDetails(Long id) { Rnr requisition = requisitionService.getFullRequisitionById(id); return prepareForREST(requisition, orderService.getOrder(id)); } }
RestRequisitionService { public ReplenishmentDTO getReplenishmentDetails(Long id) { Rnr requisition = requisitionService.getFullRequisitionById(id); return prepareForREST(requisition, orderService.getOrder(id)); }  }
RestRequisitionService { public ReplenishmentDTO getReplenishmentDetails(Long id) { Rnr requisition = requisitionService.getFullRequisitionById(id); return prepareForREST(requisition, orderService.getOrder(id)); }  @Transactional Rnr submitReport(Report report, Long userId); @Transactional Rnr submitSdpReport(Report report, Long userId); @Transactional void approve(Report report, Long requisitionId, Long userId); ReplenishmentDTO getReplenishmentDetails(Long id); List<Report> getRequisitionsByFacility(String facilityCode); }
RestRequisitionService { public ReplenishmentDTO getReplenishmentDetails(Long id) { Rnr requisition = requisitionService.getFullRequisitionById(id); return prepareForREST(requisition, orderService.getOrder(id)); }  @Transactional Rnr submitReport(Report report, Long userId); @Transactional Rnr submitSdpReport(Report report, Long userId); @Transactional void approve(Report report, Long requisitionId, Long userId); ReplenishmentDTO getReplenishmentDetails(Long id); List<Report> getRequisitionsByFacility(String facilityCode); static final boolean EMERGENCY; }