@Test public void shouldUpdatePOD() { OrderPOD orderPOD = new OrderPOD(); OrderPODLineItem lineItem1 = new OrderPODLineItem(1L, "P1", null); OrderPODLineItem lineItem2 = new OrderPODLineItem(2L, "P2", 30); orderPOD.setPodLineItems(asList(lineItem1, lineItem2)); OrderPOD updatedPOD = repository.update(orderPOD); assertThat(updatedPOD, is(orderPOD)); verify(mapper).update(orderPOD); verify(mapper).updateLineItem(lineItem1); verify(mapper).updateLineItem(lineItem2); }
public OrderPOD update(OrderPOD orderPOD) { mapper.update(orderPOD); for (OrderPODLineItem lineItem : orderPOD.getPodLineItems()) { mapper.updateLineItem(lineItem); } return orderPOD; }
PODRepository { public OrderPOD update(OrderPOD orderPOD) { mapper.update(orderPOD); for (OrderPODLineItem lineItem : orderPOD.getPodLineItems()) { mapper.updateLineItem(lineItem); } return orderPOD; } }
PODRepository { public OrderPOD update(OrderPOD orderPOD) { mapper.update(orderPOD); for (OrderPODLineItem lineItem : orderPOD.getPodLineItems()) { mapper.updateLineItem(lineItem); } return orderPOD; }  }
PODRepository { public OrderPOD update(OrderPOD orderPOD) { mapper.update(orderPOD); for (OrderPODLineItem lineItem : orderPOD.getPodLineItems()) { mapper.updateLineItem(lineItem); } return orderPOD; }  void insertPODLineItem(OrderPODLineItem orderPodLineItem); void insertPOD(OrderPOD orderPod); OrderPOD getPODByOrderId(Long orderId); List<OrderPODLineItem> getNPodLineItems(String productCode, Rnr requisition, Integer n, Date startDate); OrderPOD getPOD(Long podId); OrderPOD insert(OrderPOD orderPOD); OrderPOD update(OrderPOD orderPOD); }
PODRepository { public OrderPOD update(OrderPOD orderPOD) { mapper.update(orderPOD); for (OrderPODLineItem lineItem : orderPOD.getPodLineItems()) { mapper.updateLineItem(lineItem); } return orderPOD; }  void insertPODLineItem(OrderPODLineItem orderPodLineItem); void insertPOD(OrderPOD orderPod); OrderPOD getPODByOrderId(Long orderId); List<OrderPODLineItem> getNPodLineItems(String productCode, Rnr requisition, Integer n, Date startDate); OrderPOD getPOD(Long podId); OrderPOD insert(OrderPOD orderPOD); OrderPOD update(OrderPOD orderPOD);  }