@Test public void convertTest() { AdviceTranslation adviceTranslation = ModelUtils.getAdviceTranslation(); AdviceDTO expected = new AdviceDTO(); HabitDictionaryDto habitDictionaryDto = new HabitDictionaryDto(); habitDictionaryDto.setId(adviceTranslation.getAdvice().getHabitDictionary().getId()); habitDictionaryDto.setImage(adviceTranslation.getAdvice().getHabitDictionary().getImage()); expected.setId(adviceTranslation.getId()); expected.setContent(adviceTranslation.getContent()); expected.setHabitDictionary(habitDictionaryDto); assertEquals(expected, adviceTranslateMapper.convert(adviceTranslation)); }
@Override public AdviceDTO convert(AdviceTranslation entity) { AdviceDTO adviceDto = new AdviceDTO(); HabitDictionaryDto habitDictionaryDto = new HabitDictionaryDto(); habitDictionaryDto.setId(entity.getAdvice().getHabitDictionary().getId()); habitDictionaryDto.setImage(entity.getAdvice().getHabitDictionary().getImage()); adviceDto.setId(entity.getId()); adviceDto.setContent(entity.getContent()); adviceDto.setHabitDictionary(habitDictionaryDto); return adviceDto; }
AdviceTranslateMapper extends AbstractConverter<AdviceTranslation, AdviceDTO> { @Override public AdviceDTO convert(AdviceTranslation entity) { AdviceDTO adviceDto = new AdviceDTO(); HabitDictionaryDto habitDictionaryDto = new HabitDictionaryDto(); habitDictionaryDto.setId(entity.getAdvice().getHabitDictionary().getId()); habitDictionaryDto.setImage(entity.getAdvice().getHabitDictionary().getImage()); adviceDto.setId(entity.getId()); adviceDto.setContent(entity.getContent()); adviceDto.setHabitDictionary(habitDictionaryDto); return adviceDto; } }
AdviceTranslateMapper extends AbstractConverter<AdviceTranslation, AdviceDTO> { @Override public AdviceDTO convert(AdviceTranslation entity) { AdviceDTO adviceDto = new AdviceDTO(); HabitDictionaryDto habitDictionaryDto = new HabitDictionaryDto(); habitDictionaryDto.setId(entity.getAdvice().getHabitDictionary().getId()); habitDictionaryDto.setImage(entity.getAdvice().getHabitDictionary().getImage()); adviceDto.setId(entity.getId()); adviceDto.setContent(entity.getContent()); adviceDto.setHabitDictionary(habitDictionaryDto); return adviceDto; }  }
AdviceTranslateMapper extends AbstractConverter<AdviceTranslation, AdviceDTO> { @Override public AdviceDTO convert(AdviceTranslation entity) { AdviceDTO adviceDto = new AdviceDTO(); HabitDictionaryDto habitDictionaryDto = new HabitDictionaryDto(); habitDictionaryDto.setId(entity.getAdvice().getHabitDictionary().getId()); habitDictionaryDto.setImage(entity.getAdvice().getHabitDictionary().getImage()); adviceDto.setId(entity.getId()); adviceDto.setContent(entity.getContent()); adviceDto.setHabitDictionary(habitDictionaryDto); return adviceDto; }  @Override AdviceDTO convert(AdviceTranslation entity); }
AdviceTranslateMapper extends AbstractConverter<AdviceTranslation, AdviceDTO> { @Override public AdviceDTO convert(AdviceTranslation entity) { AdviceDTO adviceDto = new AdviceDTO(); HabitDictionaryDto habitDictionaryDto = new HabitDictionaryDto(); habitDictionaryDto.setId(entity.getAdvice().getHabitDictionary().getId()); habitDictionaryDto.setImage(entity.getAdvice().getHabitDictionary().getImage()); adviceDto.setId(entity.getId()); adviceDto.setContent(entity.getContent()); adviceDto.setHabitDictionary(habitDictionaryDto); return adviceDto; }  @Override AdviceDTO convert(AdviceTranslation entity);  }