@Test public void shouldPrepareRequisitionsForView() throws Exception { Rnr rnr = make(a(defaultRequisition, with(emergency, false))); rnr.setModifiedDate(new Date()); List<Rnr> rnrList = Arrays.asList(rnr); List<RnrDTO> rnrDTOs = RnrDTO.prepareForView(rnrList); assertThat(rnrDTOs.size(), is(1)); RnrDTO rnrDTO = rnrDTOs.get(0); assertRnrDTO(rnrDTO, rnr); assertThat(rnrDTO.getRequisitionStatus(), is(rnr.getStatus().name())); }
public static List<RnrDTO> prepareForView(List<Rnr> requisitions) { List<RnrDTO> result = new ArrayList<>(); for (Rnr requisition : requisitions) { RnrDTO rnrDTO = populateDTOWithRequisition(requisition); rnrDTO.requisitionStatus = requisition.getStatus().name(); result.add(rnrDTO); } return result; }
RnrDTO { public static List<RnrDTO> prepareForView(List<Rnr> requisitions) { List<RnrDTO> result = new ArrayList<>(); for (Rnr requisition : requisitions) { RnrDTO rnrDTO = populateDTOWithRequisition(requisition); rnrDTO.requisitionStatus = requisition.getStatus().name(); result.add(rnrDTO); } return result; } }
RnrDTO { public static List<RnrDTO> prepareForView(List<Rnr> requisitions) { List<RnrDTO> result = new ArrayList<>(); for (Rnr requisition : requisitions) { RnrDTO rnrDTO = populateDTOWithRequisition(requisition); rnrDTO.requisitionStatus = requisition.getStatus().name(); result.add(rnrDTO); } return result; }  }
RnrDTO { public static List<RnrDTO> prepareForView(List<Rnr> requisitions) { List<RnrDTO> result = new ArrayList<>(); for (Rnr requisition : requisitions) { RnrDTO rnrDTO = populateDTOWithRequisition(requisition); rnrDTO.requisitionStatus = requisition.getStatus().name(); result.add(rnrDTO); } return result; }  @Deprecated static List<RnrDTO> prepareForListApproval(List<Rnr> requisitions); static List<RnrDTO> prepareDTOsForListApproval(List<RnrDTO> requisitions); static List<RnrDTO> prepareForView(List<Rnr> requisitions); static RnrDTO prepareForOrderView(Rnr requisition); }
RnrDTO { public static List<RnrDTO> prepareForView(List<Rnr> requisitions) { List<RnrDTO> result = new ArrayList<>(); for (Rnr requisition : requisitions) { RnrDTO rnrDTO = populateDTOWithRequisition(requisition); rnrDTO.requisitionStatus = requisition.getStatus().name(); result.add(rnrDTO); } return result; }  @Deprecated static List<RnrDTO> prepareForListApproval(List<Rnr> requisitions); static List<RnrDTO> prepareDTOsForListApproval(List<RnrDTO> requisitions); static List<RnrDTO> prepareForView(List<Rnr> requisitions); static RnrDTO prepareForOrderView(Rnr requisition);  }