@Test public void convertTest() { AddHabitStatisticDto addHabitStatisticDto = ModelUtils.addHabitStatisticDto(); HabitStatistic expected = new HabitStatistic(addHabitStatisticDto.getId(), addHabitStatisticDto.getHabitRate(), addHabitStatisticDto.getCreatedOn(), addHabitStatisticDto.getAmountOfItems(), Habit.builder().id(addHabitStatisticDto.getHabitId()).build()); assertEquals(expected, habitStatisticMapper.convert(addHabitStatisticDto)); }
@Override protected HabitStatistic convert(AddHabitStatisticDto addHabitStatisticDto) { return HabitStatistic.builder() .id(addHabitStatisticDto.getId()) .amountOfItems(addHabitStatisticDto.getAmountOfItems()) .createdOn(addHabitStatisticDto.getCreatedOn()) .habitRate(addHabitStatisticDto.getHabitRate()) .build(); }
HabitStatisticMapper extends AbstractConverter<AddHabitStatisticDto, HabitStatistic> { @Override protected HabitStatistic convert(AddHabitStatisticDto addHabitStatisticDto) { return HabitStatistic.builder() .id(addHabitStatisticDto.getId()) .amountOfItems(addHabitStatisticDto.getAmountOfItems()) .createdOn(addHabitStatisticDto.getCreatedOn()) .habitRate(addHabitStatisticDto.getHabitRate()) .build(); } }
HabitStatisticMapper extends AbstractConverter<AddHabitStatisticDto, HabitStatistic> { @Override protected HabitStatistic convert(AddHabitStatisticDto addHabitStatisticDto) { return HabitStatistic.builder() .id(addHabitStatisticDto.getId()) .amountOfItems(addHabitStatisticDto.getAmountOfItems()) .createdOn(addHabitStatisticDto.getCreatedOn()) .habitRate(addHabitStatisticDto.getHabitRate()) .build(); }  }
HabitStatisticMapper extends AbstractConverter<AddHabitStatisticDto, HabitStatistic> { @Override protected HabitStatistic convert(AddHabitStatisticDto addHabitStatisticDto) { return HabitStatistic.builder() .id(addHabitStatisticDto.getId()) .amountOfItems(addHabitStatisticDto.getAmountOfItems()) .createdOn(addHabitStatisticDto.getCreatedOn()) .habitRate(addHabitStatisticDto.getHabitRate()) .build(); }   }
HabitStatisticMapper extends AbstractConverter<AddHabitStatisticDto, HabitStatistic> { @Override protected HabitStatistic convert(AddHabitStatisticDto addHabitStatisticDto) { return HabitStatistic.builder() .id(addHabitStatisticDto.getId()) .amountOfItems(addHabitStatisticDto.getAmountOfItems()) .createdOn(addHabitStatisticDto.getCreatedOn()) .habitRate(addHabitStatisticDto.getHabitRate()) .build(); }    }