@Test public void convertTest() { AddEcoNewsDtoRequest request = ModelUtils.getAddEcoNewsDtoRequest(); EcoNews actual = mapper.convert(request); actual.setImagePath(TestConst.SITE); actual.setId(1L); actual.setCreationDate(ecoNews.getCreationDate()); actual.setTags(Collections.singletonList(ModelUtils.getTag())); assertEquals(ecoNews, actual); }
@Override protected EcoNews convert(AddEcoNewsDtoRequest addEcoNewsDtoRequest) { return EcoNews.builder() .source(addEcoNewsDtoRequest.getSource()) .title(addEcoNewsDtoRequest.getTitle()) .text(addEcoNewsDtoRequest.getText()) .creationDate(ZonedDateTime.now()) .build(); }
AddEcoNewsDtoRequestMapper extends AbstractConverter<AddEcoNewsDtoRequest, EcoNews> { @Override protected EcoNews convert(AddEcoNewsDtoRequest addEcoNewsDtoRequest) { return EcoNews.builder() .source(addEcoNewsDtoRequest.getSource()) .title(addEcoNewsDtoRequest.getTitle()) .text(addEcoNewsDtoRequest.getText()) .creationDate(ZonedDateTime.now()) .build(); } }
AddEcoNewsDtoRequestMapper extends AbstractConverter<AddEcoNewsDtoRequest, EcoNews> { @Override protected EcoNews convert(AddEcoNewsDtoRequest addEcoNewsDtoRequest) { return EcoNews.builder() .source(addEcoNewsDtoRequest.getSource()) .title(addEcoNewsDtoRequest.getTitle()) .text(addEcoNewsDtoRequest.getText()) .creationDate(ZonedDateTime.now()) .build(); }  }
AddEcoNewsDtoRequestMapper extends AbstractConverter<AddEcoNewsDtoRequest, EcoNews> { @Override protected EcoNews convert(AddEcoNewsDtoRequest addEcoNewsDtoRequest) { return EcoNews.builder() .source(addEcoNewsDtoRequest.getSource()) .title(addEcoNewsDtoRequest.getTitle()) .text(addEcoNewsDtoRequest.getText()) .creationDate(ZonedDateTime.now()) .build(); }   }
AddEcoNewsDtoRequestMapper extends AbstractConverter<AddEcoNewsDtoRequest, EcoNews> { @Override protected EcoNews convert(AddEcoNewsDtoRequest addEcoNewsDtoRequest) { return EcoNews.builder() .source(addEcoNewsDtoRequest.getSource()) .title(addEcoNewsDtoRequest.getTitle()) .text(addEcoNewsDtoRequest.getText()) .creationDate(ZonedDateTime.now()) .build(); }    }