@Test public void shouldTransformRefrigeratorsDTOIntoRefrigeratorsWithBlankReadingsIfNotProvided() throws Exception { List<RefrigeratorReading> refrigeratorReadings = new ArrayList<>(); DistributionRefrigeratorsDTO refrigeratorsDTO = new DistributionRefrigeratorsDTO(); DistributionRefrigerators distributionRefrigerators = refrigeratorsDTO.transform(); assertThat(distributionRefrigerators.getReadings(), is(refrigeratorReadings)); }
public DistributionRefrigerators transform() { List<RefrigeratorReading> refrigeratorReadings = new ArrayList<>(); final Long createdBy = this.createdBy; final Long modifiedBy = this.modifiedBy; if (readings != null) { refrigeratorReadings = (List) collect(readings, new Transformer() { @Override public Object transform(Object o) { RefrigeratorReadingDTO readingDTO = (RefrigeratorReadingDTO) o; readingDTO.setCreatedBy(createdBy); readingDTO.setModifiedBy(modifiedBy); RefrigeratorReading reading = readingDTO.transform(); return reading; } }); } return new DistributionRefrigerators(refrigeratorReadings); }
DistributionRefrigeratorsDTO extends BaseModel { public DistributionRefrigerators transform() { List<RefrigeratorReading> refrigeratorReadings = new ArrayList<>(); final Long createdBy = this.createdBy; final Long modifiedBy = this.modifiedBy; if (readings != null) { refrigeratorReadings = (List) collect(readings, new Transformer() { @Override public Object transform(Object o) { RefrigeratorReadingDTO readingDTO = (RefrigeratorReadingDTO) o; readingDTO.setCreatedBy(createdBy); readingDTO.setModifiedBy(modifiedBy); RefrigeratorReading reading = readingDTO.transform(); return reading; } }); } return new DistributionRefrigerators(refrigeratorReadings); } }
DistributionRefrigeratorsDTO extends BaseModel { public DistributionRefrigerators transform() { List<RefrigeratorReading> refrigeratorReadings = new ArrayList<>(); final Long createdBy = this.createdBy; final Long modifiedBy = this.modifiedBy; if (readings != null) { refrigeratorReadings = (List) collect(readings, new Transformer() { @Override public Object transform(Object o) { RefrigeratorReadingDTO readingDTO = (RefrigeratorReadingDTO) o; readingDTO.setCreatedBy(createdBy); readingDTO.setModifiedBy(modifiedBy); RefrigeratorReading reading = readingDTO.transform(); return reading; } }); } return new DistributionRefrigerators(refrigeratorReadings); }  }
DistributionRefrigeratorsDTO extends BaseModel { public DistributionRefrigerators transform() { List<RefrigeratorReading> refrigeratorReadings = new ArrayList<>(); final Long createdBy = this.createdBy; final Long modifiedBy = this.modifiedBy; if (readings != null) { refrigeratorReadings = (List) collect(readings, new Transformer() { @Override public Object transform(Object o) { RefrigeratorReadingDTO readingDTO = (RefrigeratorReadingDTO) o; readingDTO.setCreatedBy(createdBy); readingDTO.setModifiedBy(modifiedBy); RefrigeratorReading reading = readingDTO.transform(); return reading; } }); } return new DistributionRefrigerators(refrigeratorReadings); }  DistributionRefrigerators transform(); }
DistributionRefrigeratorsDTO extends BaseModel { public DistributionRefrigerators transform() { List<RefrigeratorReading> refrigeratorReadings = new ArrayList<>(); final Long createdBy = this.createdBy; final Long modifiedBy = this.modifiedBy; if (readings != null) { refrigeratorReadings = (List) collect(readings, new Transformer() { @Override public Object transform(Object o) { RefrigeratorReadingDTO readingDTO = (RefrigeratorReadingDTO) o; readingDTO.setCreatedBy(createdBy); readingDTO.setModifiedBy(modifiedBy); RefrigeratorReading reading = readingDTO.transform(); return reading; } }); } return new DistributionRefrigerators(refrigeratorReadings); }  DistributionRefrigerators transform();  }