package Ġio . github . ad ven 2 7 . con cord ion . extensions . exam Ċ Ċ import Ġio . github . ad ven 2 7 . con cord ion . extensions . exam . core . resolve Json Ċ import Ġio . github . ad ven 2 7 . con cord ion . extensions . exam . core . resolve To Obj Ċ import Ġio . github . ad ven 2 7 . con cord ion . extensions . exam . core . toDate Ċ import Ġio . github . ad ven 2 7 . con cord ion . extensions . exam . core . toString Ċ import Ġio . github . ad ven 2 7 . con cord ion . extensions . exam . core . toString Or Ċ import Ġorg . assertj . core . api . Assertions Ċ import Ġorg . con cord ion . internal . Fixture Instance Ċ import Ġorg . con cord ion . internal . O gn l Evaluator Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . hamcrest . Matchers .` is ` Ċ import Ġorg . junit . Test Ċ import Ġjava . time . LocalDateTime Ċ import Ġjava . util . Date Ċ import Ġkotlin . test . assertEquals Ċ Ċ class ĠPlace holders Resolver Test Ġ{ ĊĠĠĠ Ġprivate Ġval Ġeval Ġ= ĠO gn l Evaluator ( Fixture Instance ( Object ())) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġcan Use Con cord ion Vars () Ġ{ ĊĠĠĠĠĠĠĠ Ġeval . set Variable ("# value ", Ġ 3 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( eval . resolve Json (" {{ value }} "), Ġ` is ` (" 3 ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( eval . resolve To Obj (" {{ value }} "), Ġ 3 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġresolve To Obj _ should Resolve Formatted Con cord ion Var ToString () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdate Ġ= ĠDate () ĊĠĠĠĠĠĠĠ Ġeval . set Variable ("# value ", Ġdate ) ĊĊĠĠĠĠĠĠĠ Ġval Ġexpected Ġ= Ġdate . toString (" dd . MM . yyyy ĠHH : mm ") ĊĠĠĠĠĠĠĠ ĠassertThat ( eval . resolve To Obj (" {{ date Format Ġvalue Ġ\" dd . MM . yyyy ĠHH : mm \" }} "). toString (), Ġ` is `( expected )) ĊĠĠĠĠĠĠĠ ĠassertThat ( eval . resolve To Obj (" {{ date Format Ġ( now Ġplus =' 1 Ġd ') Ġ' dd . MM . yyyy ĠHH : mm ' Ġminus =' 1 Ġd '}} "). toString (), Ġ` is `( expected )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` resolve To Obj Ġshould Ġskip Ġresolving Ġif Ġstarts Ġand Ġends Ġwith Ġa post rop he `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( eval . resolve To Obj (" Ġ'{{ resolve Ġ\" some \" }} ' "). toString Or (""), Ġ` is ` (" some ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( eval . resolve To Obj ("' {{ resolve Ġ\" some \" }} ' Ġ"). toString Or (""), Ġ` is ` (" some ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( eval . resolve To Obj ("' {{ resolve Ġ\" some \" }} ' "). toString Or (""), Ġ` is ` (" {{ resolve Ġ\" some \" }} ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġcan Use Json Unit Matcher Aliases () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeval . resolve Json (" {{ formatted As Ġ' dd . MM . yyyy '}} "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ` is ` ("\ ${ json - unit . matches : formatted As } dd . MM . yyyy ") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeval . resolve Json (" {{ formatted As Ġ' dd . MM . yyyy ĠHH : mm '}} "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ` is ` ("\ ${ json - unit . matches : formatted As } dd . MM . yyyy ĠHH : mm ") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeval . resolve Json (" {{ formatted And Within Ġ' yyyy - MM - dd ' Ġ' 1 d ' Ġ' 1 9 5 1 - 0 5 - 1 3 '}} "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ` is ` ("\ ${ json - unit . matches : formatted And Within } yyyy - MM - dd | param | 1 d | param | 1 9 5 1 - 0 5 - 1 3 ") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġcan Use Json Unit Matcher Alias With Regexp () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeval . resolve Json (" {{ formatted As Ġ' yyyy - MM - dd \\ ' T \\ ' HH : mm : ss [ . SSSS SSSS S ][. SSSS SS ][. SS S ]' }} "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ` is ` ("\ ${ json - unit . matches : formatted As } yyyy - MM - dd ' T ' HH : mm : ss [ . SSSS SSSS S ][. SSSS SS ][. SS S ]") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeval . resolve Json (" {{ formatted And Within Now Ġ' yyyy - MM - dd \\ ' T \\ ' HH : mm : ss [ . SSSS SSSS S ][. SSSS SS ][. SS S ]' Ġ' 1 d '}} "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ` is ` ("\ ${ json - unit . matches : formatted And Within Now } yyyy - MM - dd ' T ' HH : mm : ss [ . SSSS SSSS S ][. SSSS SS ][. SS S ]| param | 1 d ") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġexam Date Variables () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġp Ġ= Ġ" dd . MM . yyyy ' T ' hh : mm : ss " ĊĠĠĠĠĠĠĠ ĠassertThat ( eval . resolve Json (" {{ now Ġ\"$ p \" }} "), Ġ` is `( Date (). toString ( p ))) ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( eval . resolve To Obj (" {{ now }} ") Ġas ĠDate ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. is Close To ( Date (), Ġ 1 0 0 0 ) ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( eval . resolve To Obj (" {{ now Ġminus =' 1 Ġd '}} ") Ġas ĠDate ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. is Close To ( LocalDateTime . now (). minus Days ( 1 ). toDate (), Ġ 1 0 0 0 ) ĊĠĠĠ Ġ} Ċ } Ċ