package Ġno . nav . sy fo . model Ċ Ċ import Ġcom . fasterxml . jackson . databind . Deserialization Feature Ċ import Ġcom . fasterxml . jackson . databind . ObjectMapper Ċ import Ġcom . fasterxml . jackson . databind . Serialization Feature Ċ import Ġcom . fasterxml . jackson . datatype . js r 3 1 0 . Java Time Module Ċ import Ġcom . fasterxml . jackson . module . kotlin . readValue Ċ import Ġcom . fasterxml . jackson . module . kotlin . register Kotlin Module Ċ import Ġorg . am sh ove . k lu ent . should Equal Ċ import Ġorg . am sh ove . k lu ent . should Not Be Ċ import Ġorg . spe k framework . spe k 2 . Spe k Ċ import Ġorg . spe k framework . spe k 2 . style . specification . describe Ċ import Ġjava . time . LocalDateTime Ċ import Ġjava . time . Month Ċ Ċ object ĠReceived Sy k meld ing Spe k Ġ: ĠSpe k ({ ĊĠĠĠ Ġval ĠobjectMapper Ġ= ĠObjectMapper () ĊĠĠĠĠĠĠĠ Ġ. register Kotlin Module () ĊĠĠĠĠĠĠĠ Ġ. register Module ( Java Time Module ()) ĊĠĠĠĠĠĠĠ Ġ. configure ( Deserialization Feature . FAIL _ ON _ UNKNOWN _ PROPERTIES , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġ. configure ( Serialization Feature . WRITE _ DAT ES _ AS _ TIMESTAMP S , Ġfalse ) ĊĊĠĠĠ Ġdescribe (" Val ider ing Ġav ĠReceived Sy k meld ing ") Ġ{ ĊĠĠĠĠĠĠĠ Ġit (" M aks imal Ġgy ld ig ĠReceived Sy k meld ing Ġskal Ġvalid ere Ġok ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġreceived Sy k meld ing : ĠReceived Sy k meld ing Ġ= ĠobjectMapper . readValue ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠReceived Sy k meld ing :: class . java . getResource AsStream ("/ gy ld ig - received sy k meld ing - mak s imal . json "). read Bytes (). toString ( Charsets . UTF _ 8 )) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceived Sy k meld ing . mot t att D ato Ġshould Equal ĠLocalDateTime . of ( 2 0 2 0 , ĠMonth . J AN U ARY , Ġ 1 , Ġ 1 2 , Ġ 2 8 , Ġ 4 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceived Sy k meld ing . sy k meld ing . id Ġshould Equal Ġ" b 5 e 8 4 7 9 5 - 4 3 a 8 - 4 adb - ac 1 d - 4 b 2 e 1 e 0 c 5 fb 7 " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceived Sy k meld ing . sy k meld ing . ar be id sg iver Ġshould Equal ĠAr be id sg iver ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhar Ar be id sg iver Ġ= ĠHar Ar be id sg iver . EN _ AR BE ID SG IVER , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnav n Ġ= Ġ" Min ĠBed rift ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġy r kes bet e gn else Ġ= Ġ" K ons ul ent ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstill ing sp ros ent Ġ= Ġ 1 0 0 ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceived Sy k meld ing . sy k meld ing . ut dy pen de Op pl ys ning er [" 6 . 3 "] Ġshould Not Be Ġnull ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġit (" Minimal Ġgy ld ig ĠReceived Sy k meld ing Ġskal Ġvalid ere Ġok ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġreceived Sy k meld ing : ĠReceived Sy k meld ing Ġ= ĠobjectMapper . readValue ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠReceived Sy k meld ing :: class . java . getResource AsStream ("/ gy ld ig - received sy k meld ing - minimal . json "). read Bytes (). toString ( Charsets . UTF _ 8 )) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceived Sy k meld ing . msg Id Ġshould Equal Ġ" A 2 4 A 4 DD 6 - AE 6 1 - 4 9 3 B - A 0 C 9 - 4 6 FD 4 5 F 8 5 9 DB " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceived Sy k meld ing . lege kont or Org Nr Ġshould Equal Ġnull ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceived Sy k meld ing . sy k meld ing . be handler . et tern av n Ġshould Equal Ġ" Super lege " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceived Sy k meld ing . sy k meld ing . kont akt Med Pas ient . be gr un n else Ik ke Kont akt Ġshould Equal Ġnull ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }) Ċ