package Ġno . nav . f amil ie . ef . mot tak . no . nav . f amil ie . ef . mot tak . repository Ċ Ċ import Ġno . nav . f amil ie . ef . mot tak . Integr as jon Spring Runner Test Ċ import Ġno . nav . f amil ie . ef . mot tak . no . nav . f amil ie . ef . mot tak . util . s Ã¸ kn ad Ċ import Ġno . nav . f amil ie . ef . mot tak . repository . S Ã¸ kn ad Repository Ċ import Ġno . nav . f amil ie . ef . mot tak . repository . V ed leg g Repository Ċ import Ġno . nav . f amil ie . ef . mot tak . repository . domain . Fil Ċ import Ġno . nav . f amil ie . ef . mot tak . repository . domain . V ed leg g Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . assertj . core . api . Assertions . catch Throwable Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . test . context . Active Profiles Ċ import Ġorg . springframework . transaction . Transaction System Exception Ċ import Ġjava . util .* Ċ Ċ @ Active Profiles (" local ") Ċ internal Ġclass ĠV ed leg g Repository Test Ġ: ĠIntegr as jon Spring Runner Test () Ġ{ ĊĊĠĠĠ Ġ@ Autowired Ġlateinit Ġvar Ġs Ã¸ kn ad Repository : ĠS Ã¸ kn ad Repository ĊĊĠĠĠ Ġ@ Autowired Ġlateinit Ġvar Ġved leg g Repository : ĠV ed leg g Repository ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` findBy S Ã¸ kn ad Id Ġreturn er er Ġved leg g `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġs Ã¸ kn ad Id Ġ= Ġs Ã¸ kn ad Repository . save ( s Ã¸ kn ad ()). id ĊĠĠĠĠĠĠĠ Ġved leg g Repository . save ( V ed leg g ( UUID . randomUUID (), Ġs Ã¸ kn ad Id , Ġ" nav n ", Ġ" tit tel 1 ", ĠFil ( byte ArrayOf ( 1 2 )))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( ved leg g Repository . findBy S Ã¸ kn ad Id ( s Ã¸ kn ad Id )). has Size ( 1 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( ved leg g Repository . findBy S Ã¸ kn ad Id (" fin nes Ġik ke ")). isEmpty () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` find T it ler By S Ã¸ kn ad Id Ġreturn er er Ġt it ler `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġs Ã¸ kn ad Id Ġ= Ġs Ã¸ kn ad Repository . save ( s Ã¸ kn ad ()). id ĊĠĠĠĠĠĠĠ Ġved leg g Repository . save ( V ed leg g ( UUID . randomUUID (), Ġs Ã¸ kn ad Id , Ġ" nav n ", Ġ" tit tel 1 ", ĠFil ( byte ArrayOf ( 1 2 )))) ĊĊĠĠĠĠĠĠĠ Ġval Ġved leg g Ġ= Ġved leg g Repository . find T it ler By S Ã¸ kn ad Id ( s Ã¸ kn ad Id ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( ved leg g ). has Size ( 1 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` det Ġskal Ġik ke Ġv Ã¦ re Ġmul ig ĠÃ¥ Ġopp dat ere Ġet Ġved leg g Ġmed Ġny Ġs Ã¸ kn ad Id `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġved leg g Id Ġ= ĠUUID . randomUUID () ĊĠĠĠĠĠĠĠ Ġval Ġs Ã¸ kn ad Id Ġ= Ġs Ã¸ kn ad Repository . save ( s Ã¸ kn ad ()). id ĊĠĠĠĠĠĠĠ Ġved leg g Repository . save ( V ed leg g ( ved leg g Id , Ġs Ã¸ kn ad Id , Ġ" nav n ", Ġ" tit tel 1 ", ĠFil ( byte ArrayOf ( 1 2 )))) ĊĊĠĠĠĠĠĠĠ Ġval Ġs Ã¸ kn ad 2 Id Ġ= Ġs Ã¸ kn ad Repository . save ( s Ã¸ kn ad ()). id ĊĠĠĠĠĠĠĠ ĠassertThat ( catch Throwable Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġved leg g Repository . save ( V ed leg g ( ved leg g Id , Ġs Ã¸ kn ad 2 Id , Ġ" nav n ", Ġ" tit tel 1 ", ĠFil ( byte ArrayOf ( 1 2 )))) ĊĠĠĠĠĠĠĠ Ġ}). isInstanceOf ( Transaction System Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Root Cause Message (" Det Ġg Ã¥r Ġik ke ĠÃ¥ Ġopp dat ere Ġved leg g ") ĊĊĠĠĠĠĠĠĠ ĠassertThat ( catch Throwable Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġved leg g Repository . save All ( listOf ( V ed leg g ( ved leg g Id , Ġs Ã¸ kn ad 2 Id , Ġ" nav n ", Ġ" tit tel 1 ", ĠFil ( byte ArrayOf ( 1 2 ))))) ĊĠĠĠĠĠĠĠ Ġ}). isInstanceOf ( Transaction System Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Root Cause Message (" Det Ġg Ã¥r Ġik ke ĠÃ¥ Ġopp dat ere Ġved leg g ") ĊĠĠĠ Ġ} Ċ } Ċ