@Test public void shouldCreatePODLineItemsWithShipmentLineItemEvenIfPackSize0() throws Exception { Long createdBy = 1L; ShipmentLineItem shipmentLineItem = make(a(ShipmentLineItemBuilder.defaultShipmentLineItem)); shipmentLineItem.setPacksToShip(0); List<ShipmentLineItem> shipmentLineItems = asList(shipmentLineItem); OrderPOD orderPOD = new OrderPOD(); orderPOD.fillPODLineItems(shipmentLineItems); whenNew(OrderPODLineItem.class).withArguments(shipmentLineItem, createdBy).thenReturn(mock(OrderPODLineItem.class)); assertThat(orderPOD.getPodLineItems().size(), is(1)); }
public void fillPODLineItems(List<? extends LineItem> lineItems) { this.podLineItems = new ArrayList<>(); for (LineItem lineItem : lineItems) { if (!validPacksToShip(lineItem)) continue; this.podLineItems.add(new OrderPODLineItem(lineItem, this.createdBy)); } }
OrderPOD extends BaseModel { public void fillPODLineItems(List<? extends LineItem> lineItems) { this.podLineItems = new ArrayList<>(); for (LineItem lineItem : lineItems) { if (!validPacksToShip(lineItem)) continue; this.podLineItems.add(new OrderPODLineItem(lineItem, this.createdBy)); } } }
OrderPOD extends BaseModel { public void fillPODLineItems(List<? extends LineItem> lineItems) { this.podLineItems = new ArrayList<>(); for (LineItem lineItem : lineItems) { if (!validPacksToShip(lineItem)) continue; this.podLineItems.add(new OrderPODLineItem(lineItem, this.createdBy)); } } OrderPOD(Long id);  OrderPOD(Long orderId, String orderNumber, Long userId); }
OrderPOD extends BaseModel { public void fillPODLineItems(List<? extends LineItem> lineItems) { this.podLineItems = new ArrayList<>(); for (LineItem lineItem : lineItems) { if (!validPacksToShip(lineItem)) continue; this.podLineItems.add(new OrderPODLineItem(lineItem, this.createdBy)); } } OrderPOD(Long id);  OrderPOD(Long orderId, String orderNumber, Long userId); void validate(); void fillPOD(Rnr requisition); void fillPODLineItems(List<? extends LineItem> lineItems); void copy(OrderPOD orderPOD); @JsonIgnore String getStringReceivedDate(); Date trimHoursFromDate(Date receivedDate); }
OrderPOD extends BaseModel { public void fillPODLineItems(List<? extends LineItem> lineItems) { this.podLineItems = new ArrayList<>(); for (LineItem lineItem : lineItems) { if (!validPacksToShip(lineItem)) continue; this.podLineItems.add(new OrderPODLineItem(lineItem, this.createdBy)); } } OrderPOD(Long id);  OrderPOD(Long orderId, String orderNumber, Long userId); void validate(); void fillPOD(Rnr requisition); void fillPODLineItems(List<? extends LineItem> lineItems); void copy(OrderPOD orderPOD); @JsonIgnore String getStringReceivedDate(); Date trimHoursFromDate(Date receivedDate);  }