@Test public void testNotUpdatingExistingValues() { final String intygsId = "intygsid"; final String arbetsplatskod = "ARBETSPLATSKOD"; final String epost = "EPOST"; final LocalDateTime handelsetid = LocalDateTime.now().minusDays(1); final HandelsekodEnum handelsetyp = HandelsekodEnum.ANDRAT; Intyg intyg = buildIntyg(); Enhet enhet = intyg.getSkapadAv().getEnhet(); enhet.getArbetsplatskod().setExtension(arbetsplatskod); enhet.setEpost(epost); NotificationMessage msg = new NotificationMessage(intygsId, "luse", handelsetid, handelsetyp, "address", "", null, new ArendeCount(4, 3, 2, 1), new ArendeCount(4, 3, 2, 1), SchemaVersion.VERSION_3, "ref"); CertificateStatusUpdateForCareType res = NotificationTypeConverter.convert(msg, intyg); assertEquals(arbetsplatskod, res.getIntyg().getSkapadAv().getEnhet().getArbetsplatskod().getExtension()); assertEquals(epost, res.getIntyg().getSkapadAv().getEnhet().getEpost()); }
public static CertificateStatusUpdateForCareType convert(NotificationMessage notificationMessage, Intyg intyg) { CertificateStatusUpdateForCareType destination = new CertificateStatusUpdateForCareType(); complementIntyg(intyg); destination.setIntyg(intyg); decorateWithHandelse(destination, notificationMessage); decorateWithArenden(destination, notificationMessage); destination.setRef(notificationMessage.getReference()); return destination; }
NotificationTypeConverter { public static CertificateStatusUpdateForCareType convert(NotificationMessage notificationMessage, Intyg intyg) { CertificateStatusUpdateForCareType destination = new CertificateStatusUpdateForCareType(); complementIntyg(intyg); destination.setIntyg(intyg); decorateWithHandelse(destination, notificationMessage); decorateWithArenden(destination, notificationMessage); destination.setRef(notificationMessage.getReference()); return destination; } }
NotificationTypeConverter { public static CertificateStatusUpdateForCareType convert(NotificationMessage notificationMessage, Intyg intyg) { CertificateStatusUpdateForCareType destination = new CertificateStatusUpdateForCareType(); complementIntyg(intyg); destination.setIntyg(intyg); decorateWithHandelse(destination, notificationMessage); decorateWithArenden(destination, notificationMessage); destination.setRef(notificationMessage.getReference()); return destination; } private  NotificationTypeConverter(); }
NotificationTypeConverter { public static CertificateStatusUpdateForCareType convert(NotificationMessage notificationMessage, Intyg intyg) { CertificateStatusUpdateForCareType destination = new CertificateStatusUpdateForCareType(); complementIntyg(intyg); destination.setIntyg(intyg); decorateWithHandelse(destination, notificationMessage); decorateWithArenden(destination, notificationMessage); destination.setRef(notificationMessage.getReference()); return destination; } private  NotificationTypeConverter(); static CertificateStatusUpdateForCareType convert(NotificationMessage notificationMessage, Intyg intyg); static Arenden toArenden(ArendeCount source); }
NotificationTypeConverter { public static CertificateStatusUpdateForCareType convert(NotificationMessage notificationMessage, Intyg intyg) { CertificateStatusUpdateForCareType destination = new CertificateStatusUpdateForCareType(); complementIntyg(intyg); destination.setIntyg(intyg); decorateWithHandelse(destination, notificationMessage); decorateWithArenden(destination, notificationMessage); destination.setRef(notificationMessage.getReference()); return destination; } private  NotificationTypeConverter(); static CertificateStatusUpdateForCareType convert(NotificationMessage notificationMessage, Intyg intyg); static Arenden toArenden(ArendeCount source);  }