package Ġio . hol unda . camunda . task pool . example . task list . rest . mapper Ċ Ċ import Ġio . hol unda . camunda . task pool . api . task . Process Reference Ċ import Ġio . hol unda . poly flow . view . Data Entry Ċ import Ġio . hol unda . poly flow . view . Form Url Resolver Ċ import Ġio . hol unda . poly flow . view . Process Definition Ċ import Ġio . hol unda . poly flow . view . Task Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . map struct . factory . Map pers Ċ import Ġorg . springframework . test . util . Reflection TestUtils Ċ Ċ class ĠTask WithData Entries Mapper Test Ġ{ ĊĊĠ Ġprivate Ġval Ġform Url Resolver Ġ= Ġobject Ġ: ĠForm Url Resolver Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġresolve Url ( data Entry : ĠData Entry ) Ġ= Ġ" http :// localhost : 8 0 8 0 / test / forms / bo / id / 1 " ĊĠĠĠ Ġoverride Ġfun Ġresolve Url ( task : ĠTask ) Ġ= Ġ" http :// localhost : 8 0 8 0 / test / forms / the - task / id / 1 " ĊĠĠĠ Ġoverride Ġfun Ġresolve Url ( process Definition : ĠProcess Definition ) Ġ= Ġ" http :// localhost : 8 0 8 0 / test / start " ĊĠ Ġ} ĊĊĠ Ġprivate Ġval Ġsource Reference : ĠProcess Reference Ġ= ĠProcess Reference ( ĊĠĠĠ Ġapplication Name Ġ= Ġ" test ", ĊĠĠĠ Ġname Ġ= Ġ" Test ĠProcess ", ĊĠĠĠ Ġinstance Id Ġ= Ġ" 1 ", ĊĠĠĠ Ġexecution Id Ġ= Ġ" 1 ", ĊĠĠĠ Ġdefinition Key Ġ= Ġ" test - process ", ĊĠĠĠ Ġdefinition Id Ġ= Ġ" test - process # 1 " ĊĠ Ġ) ĊĊĠ Ġprivate Ġval Ġmapper Ġ= ĠMap pers . get Mapper ( Task WithData Entries Mapper :: class . java ) !! ĊĊĠ Ġ@ Before ĊĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠ ĠReflection TestUtils . setField ( mapper , Ġ" form Url Resolver ", Ġform Url Resolver ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` resolves Ġurl Ġfor Ġgiven Ġtask `() Ġ{ ĊĠĠĠ Ġval Ġtask Ġ= ĠTask ( ĊĠĠĠĠĠ Ġid Ġ= Ġ" 1 ", ĊĠĠĠĠĠ Ġsource Reference Ġ= Ġsource Reference , ĊĠĠĠĠĠ Ġtask Definition Key Ġ= Ġ" the - task ", ĊĠĠĠĠĠ Ġform Key Ġ= Ġ" the - task " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġdto Ġ= Ġmapper . dto ( task ) ĊĊĠĠĠ ĠassertThat ( dto . url ). isEqualTo (" http :// localhost : 8 0 8 0 / test / forms / the - task / id / 1 ") ĊĠĠĠ ĠassertThat ( dto . form Key ). isEqualTo (" the - task ") ĊĠĠĠ ĠassertThat ( dto . process Name ). isEqualTo ( source Reference . name ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` resolves Ġurl Ġfor Ġgiven Ġbo `() Ġ{ ĊĠĠĠ Ġval Ġbo Ġ= ĠData Entry ( ĊĠĠĠĠĠ Ġentry Id Ġ= Ġ" 1 ", ĊĠĠĠĠĠ Ġentry Type Ġ= Ġ" bo ", ĊĠĠĠĠĠ Ġapplication Name Ġ= Ġ" my - app ", ĊĠĠĠĠĠ Ġform Key Ġ= Ġ" the - bo ", ĊĠĠĠĠĠ Ġtype Ġ= Ġ" BO ", ĊĠĠĠĠĠ Ġname Ġ= Ġ" BO Ġ 1 " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġdto Ġ= Ġmapper . dto ( bo ) ĊĊĠĠĠ ĠassertThat ( dto . url ). isEqualTo (" http :// localhost : 8 0 8 0 / test / forms / bo / id / 1 ") ĊĠĠĠ ĠassertThat ( dto . form Key ). isEqualTo (" the - bo ") ĊĠĠĠ ĠassertThat ( dto . application Name ). isEqualTo (" my - app ") ĊĊĠ Ġ} Ċ Ċ } Ċ