@Test public void shouldCopySomeFieldsFromLineItemIntoAnother() { Long modifiedBy = 1L; String notes = "Notes"; OrderPODLineItem lineItem = new OrderPODLineItem(1L, "P1", null); OrderPODLineItem otherLineItem = new OrderPODLineItem(1L, "P1", 30); otherLineItem.setNotes(notes); otherLineItem.setModifiedBy(modifiedBy); otherLineItem.setQuantityReturned(300); lineItem.copy(otherLineItem); assertThat(lineItem.getQuantityReceived(), is(30)); assertThat(lineItem.getQuantityReturned(), is(300)); assertThat(lineItem.getNotes(), is(notes)); assertThat(lineItem.getModifiedBy(), is(modifiedBy)); }
public void copy(OrderPODLineItem lineItem) { this.setQuantityReceived(lineItem.getQuantityReceived()); this.setQuantityReturned(lineItem.getQuantityReturned()); this.setNotes(lineItem.getNotes()); this.setModifiedBy(lineItem.getModifiedBy()); }
OrderPODLineItem extends BaseModel { public void copy(OrderPODLineItem lineItem) { this.setQuantityReceived(lineItem.getQuantityReceived()); this.setQuantityReturned(lineItem.getQuantityReturned()); this.setNotes(lineItem.getNotes()); this.setModifiedBy(lineItem.getModifiedBy()); } }
OrderPODLineItem extends BaseModel { public void copy(OrderPODLineItem lineItem) { this.setQuantityReceived(lineItem.getQuantityReceived()); this.setQuantityReturned(lineItem.getQuantityReturned()); this.setNotes(lineItem.getNotes()); this.setModifiedBy(lineItem.getModifiedBy()); } OrderPODLineItem(Long podId, String productCode, Integer quantityReceived);  OrderPODLineItem(LineItem lineItem, Long createdBy); }
OrderPODLineItem extends BaseModel { public void copy(OrderPODLineItem lineItem) { this.setQuantityReceived(lineItem.getQuantityReceived()); this.setQuantityReturned(lineItem.getQuantityReturned()); this.setNotes(lineItem.getNotes()); this.setModifiedBy(lineItem.getModifiedBy()); } OrderPODLineItem(Long podId, String productCode, Integer quantityReceived);  OrderPODLineItem(LineItem lineItem, Long createdBy); void validate(); void copy(OrderPODLineItem lineItem); }
OrderPODLineItem extends BaseModel { public void copy(OrderPODLineItem lineItem) { this.setQuantityReceived(lineItem.getQuantityReceived()); this.setQuantityReturned(lineItem.getQuantityReturned()); this.setNotes(lineItem.getNotes()); this.setModifiedBy(lineItem.getModifiedBy()); } OrderPODLineItem(Long podId, String productCode, Integer quantityReceived);  OrderPODLineItem(LineItem lineItem, Long createdBy); void validate(); void copy(OrderPODLineItem lineItem);  }