@Test public void shouldReturnEpiUseLineItem() throws Exception { Reading stockAtFirstOfMonth = new Reading("12345", false); Reading stockAtEndOfMonth = new Reading("1000", false); Reading received = new Reading("12345", false); Reading loss = new Reading("12345", false); Reading distributed = new Reading("12345", false); Reading expirationDate = new Reading("12/2013", false); Long facilityVisitId = 1L; EpiUseLineItemDTO epiUseLineItemDTO = new EpiUseLineItemDTO(facilityVisitId, null, stockAtFirstOfMonth, stockAtEndOfMonth, received, loss, distributed, expirationDate); EpiUseLineItem epiUseLineItem = epiUseLineItemDTO.transform(); assertThat(epiUseLineItem.getStockAtFirstOfMonth(), is(12345)); assertThat(epiUseLineItem.getStockAtEndOfMonth(), is(1000)); assertThat(epiUseLineItem.getReceived(), is(12345)); assertThat(epiUseLineItem.getLoss(), is(12345)); assertThat(epiUseLineItem.getDistributed(), is(12345)); assertThat(epiUseLineItem.getExpirationDate(), is("12/2013")); assertThat(epiUseLineItem.getFacilityVisitId(), is(facilityVisitId)); }
public EpiUseLineItem transform() { EpiUseLineItem epiUseLineItem = new EpiUseLineItem(this.facilityVisitId, this.productGroup, this.stockAtFirstOfMonth.parsePositiveInt(), this.stockAtEndOfMonth.parsePositiveInt(), this.received.parsePositiveInt(), this.loss.parsePositiveInt(), this.distributed.parsePositiveInt(), this.expirationDate.getEffectiveValue()); epiUseLineItem.setId(this.id); epiUseLineItem.setModifiedBy(this.modifiedBy); return epiUseLineItem; }
EpiUseLineItemDTO extends BaseModel { public EpiUseLineItem transform() { EpiUseLineItem epiUseLineItem = new EpiUseLineItem(this.facilityVisitId, this.productGroup, this.stockAtFirstOfMonth.parsePositiveInt(), this.stockAtEndOfMonth.parsePositiveInt(), this.received.parsePositiveInt(), this.loss.parsePositiveInt(), this.distributed.parsePositiveInt(), this.expirationDate.getEffectiveValue()); epiUseLineItem.setId(this.id); epiUseLineItem.setModifiedBy(this.modifiedBy); return epiUseLineItem; } }
EpiUseLineItemDTO extends BaseModel { public EpiUseLineItem transform() { EpiUseLineItem epiUseLineItem = new EpiUseLineItem(this.facilityVisitId, this.productGroup, this.stockAtFirstOfMonth.parsePositiveInt(), this.stockAtEndOfMonth.parsePositiveInt(), this.received.parsePositiveInt(), this.loss.parsePositiveInt(), this.distributed.parsePositiveInt(), this.expirationDate.getEffectiveValue()); epiUseLineItem.setId(this.id); epiUseLineItem.setModifiedBy(this.modifiedBy); return epiUseLineItem; }  }
EpiUseLineItemDTO extends BaseModel { public EpiUseLineItem transform() { EpiUseLineItem epiUseLineItem = new EpiUseLineItem(this.facilityVisitId, this.productGroup, this.stockAtFirstOfMonth.parsePositiveInt(), this.stockAtEndOfMonth.parsePositiveInt(), this.received.parsePositiveInt(), this.loss.parsePositiveInt(), this.distributed.parsePositiveInt(), this.expirationDate.getEffectiveValue()); epiUseLineItem.setId(this.id); epiUseLineItem.setModifiedBy(this.modifiedBy); return epiUseLineItem; }  EpiUseLineItem transform(); }
EpiUseLineItemDTO extends BaseModel { public EpiUseLineItem transform() { EpiUseLineItem epiUseLineItem = new EpiUseLineItem(this.facilityVisitId, this.productGroup, this.stockAtFirstOfMonth.parsePositiveInt(), this.stockAtEndOfMonth.parsePositiveInt(), this.received.parsePositiveInt(), this.loss.parsePositiveInt(), this.distributed.parsePositiveInt(), this.expirationDate.getEffectiveValue()); epiUseLineItem.setId(this.id); epiUseLineItem.setModifiedBy(this.modifiedBy); return epiUseLineItem; }  EpiUseLineItem transform();  }