package Ġcom . merc ate o . json schema . property . mapper Ċ Ċ import Ġcom . merc ate o . json schema . Schema Context Ċ import Ġcom . merc ate o . json schema . mapper . Property Checker Ċ import Ġcom . merc ate o . json schema . property . Basic Property Builder Ċ import Ġcom . merc ate o . json schema . property . collector . Field Collector Ċ import Ġcom . merc ate o . json schema . property . from Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġio . mock k . verify All Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test ĊĊ Ċ class ĠChecked Property Mapper Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġu ut : ĠChecked Property Mapper ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġproperty Checker : ĠProperty Checker ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġu ut Ġ= ĠChecked Property Mapper () ĊĠĠĠĠĠĠĠ Ġproperty Checker Ġ= Ġmock k () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġmaps Properties () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġproperty Builder Ġ= ĠBasic Property Builder ( raw Property Collectors Ġ= ĠlistOf ( Field Collector ())) ĊĊĠĠĠĠĠĠĠ Ġval Ġproperty Ġ= Ġproperty Builder . from ( Checked Property Mapper Classes . Simple :: class . java ) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġproperty Checker . test ( any ()) Ġ} Ġreturns Ġtrue ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġu ut . from ( property , ĠSchema Context ( property Checker )) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( result . children ). has Size ( 2 ) ĊĊĠĠĠĠĠĠĠ Ġverify All Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproperty Checker . test ( property . children . find Ġ{ Ġit . name Ġ== Ġ" foo " Ġ} !! ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproperty Checker . test ( property . children . find Ġ{ Ġit . name Ġ== Ġ" bar " Ġ} !! ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġdisables Properties () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġproperty Builder Ġ= ĠBasic Property Builder ( raw Property Collectors Ġ= ĠlistOf ( Field Collector ())) ĊĊĠĠĠĠĠĠĠ Ġval Ġproperty Ġ= Ġproperty Builder . from ( Checked Property Mapper Classes . Simple :: class . java ) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġproperty Checker . test ( any ()) Ġ} Ġreturns Ġfalse ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġu ut . from ( property , ĠSchema Context ( property Checker )) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( result . children ). isEmpty () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġhandles Nested Properties () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġproperty Builder Ġ= ĠBasic Property Builder ( raw Property Collectors Ġ= ĠlistOf ( Field Collector ())) ĊĠĠĠĠĠĠĠ Ġval Ġreferenced Property Mapper Ġ= ĠRefer enced Property Mapper () ĊĊĠĠĠĠĠĠĠ Ġval Ġproperty Ġ= Ġreferenced Property Mapper . from ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġproperty Builder . from ( Checked Property Mapper Classes . Nested :: class . java ), ĠSchema Context ( property Checker )) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġproperty Checker . test ( any ()) Ġ} Ġreturns Ġtrue ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġu ut . from ( property , ĠSchema Context ( property Checker )) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( result . children ). has Size ( 2 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġproperty With Children Ġ= Ġproperty . children . find Ġ{ Ġit . reference Ġ== Ġnull Ġ} !! ĊĊĠĠĠĠĠĠĠ Ġverify All Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproperty Checker . test ( property . children . find Ġ{ Ġit . name Ġ== Ġ" first " Ġ} !! ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproperty Checker . test ( property . children . find Ġ{ Ġit . name Ġ== Ġ" second " Ġ} !! ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproperty Checker . test ( property With Children . children . find Ġ{ Ġit . name Ġ== Ġ" foo " Ġ} !! ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproperty Checker . test ( property With Children . children . find Ġ{ Ġit . name Ġ== Ġ" bar " Ġ} !! ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }