WorkerMapStructMapper { @Mapping(target = "birthDate", dateFormat = "dd.MM.yyyy") @Mapping(source = "company", target = "companyName") @Mapping(source = "emailList", target = "firstEmail") public abstract WorkerInfo workerToWorkerInfo(Worker worker);  @Mapping(target = "birthDate", dateFormat = "dd.MM.yyyy") @Mapping(source = "company", target = "companyName") @Mapping(source = "emailList", target = "firstEmail") abstract WorkerInfo workerToWorkerInfo(Worker worker); String addressToString(Address address); static final WorkerMapStructMapper INSTANCE; }
@Test public void shouldMapWorkerToWorkerInfo() { Worker worker = Main.prepareWorker(); WorkerInfo workerInfo = WorkerMapStructMapper.INSTANCE.workerToWorkerInfo(worker); checkWorkerInfo(workerInfo); }