package Ġnet . ad ri ant od t . not ion api . tests . building . richt ext Ċ Ċ import Ġnet . ad ri ant od t . not ion api . net . request . richt ext . Equation Builder Ċ import Ġnet . ad ri ant od t . not ion api . net . request . richt ext . Mention Builder Ċ import Ġnet . ad ri ant od t . not ion api . net . request . richt ext . Text Builder Ċ import Ġorg . junit . jupiter . api . Assertions . assertEquals Ċ import Ġorg . junit . jupiter . api . Assertions . assertTrue Ċ import Ġorg . junit . jupiter . params . Parameterized Test Ċ import Ġorg . junit . jupiter . params . provider . Method Source Ċ import Ġjava . time . LocalDate Ċ import Ġjava . time . Offset DateTime Ċ import Ġjava . time . format . DateTime Formatter Ċ import Ġjava . util . UUID . randomUUID Ċ Ċ class ĠRich Text Building Ġ{ ĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġequation `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠE quation Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ+ "/ alpha " ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" equation ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" equation ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġequation Ġ= Ġjson . getObject (" equation ") ĊĠĠĠĠĠĠĠ ĠassertEquals ("/ alpha ", Ġequation . getString (" expression ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġtext `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠText Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ+" This Ġis Ġa Ġexample ." ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" text ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" text ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġtext Ġ= Ġjson . getObject (" text ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( text . has (" content ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" This Ġis Ġa Ġexample .", Ġtext . getString (" content ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġlink `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠText Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ+" This Ġis Ġa Ġexample ." ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlink Url Ġ= Ġ" http :// example . com " ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" text ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" text ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġtext Ġ= Ġjson . getObject (" text ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( text . has (" content ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" This Ġis Ġa Ġexample .", Ġtext . getString (" content ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( text . has (" link ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġlink Ġ= Ġtext . getObject (" link ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( link . has (" url ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" http :// example . com ", Ġlink . getString (" url ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġpage Ġmention `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuuid Ġ= Ġrandom UUID (). toString () ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠM ention Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpage ( uuid ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" mention ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" mention ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġmention Ġ= Ġjson . getObject (" mention ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" type ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" page ", Ġmention . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" page ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġpage Ġ= Ġmention . getObject (" page ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( page . has (" id ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( uuid , Ġpage . getString (" id ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġdatabase Ġmention `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuuid Ġ= Ġrandom UUID (). toString () ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠM ention Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdatabase ( uuid ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" mention ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" mention ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġmention Ġ= Ġjson . getObject (" mention ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" type ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" database ", Ġmention . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" database ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġdatabase Ġ= Ġmention . getObject (" database ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( database . has (" id ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( uuid , Ġdatabase . getString (" id ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġuser Ġmention `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuuid Ġ= Ġrandom UUID (). toString () ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠM ention Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġuser ( uuid ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" mention ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" mention ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġmention Ġ= Ġjson . getObject (" mention ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" type ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" user ", Ġmention . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" user ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġuser Ġ= Ġmention . getObject (" user ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( user . has (" object ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" user ", Ġuser . getString (" object ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( user . has (" id ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( uuid , Ġuser . getString (" id ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġdate Ġmention `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnow Ġ= ĠLocalDate . now () ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠM ention Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdate ( now ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" mention ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" mention ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġmention Ġ= Ġjson . getObject (" mention ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" type ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" date ", Ġmention . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" date ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġdate Ġ= Ġmention . getObject (" date ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( date . has (" start ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( now . format ( DateTime Formatter . ISO _ LOCAL _ DATE ), Ġdate . getString (" start ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġdate Ġrange Ġmention `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstart Ġ= ĠLocalDate . now () ĊĠĠĠĠĠĠĠ Ġval Ġend Ġ= Ġstart . plus Days ( 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠM ention Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdate ( start , Ġend ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" mention ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" mention ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġmention Ġ= Ġjson . getObject (" mention ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" type ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" date ", Ġmention . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" date ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġdate Ġ= Ġmention . getObject (" date ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( date . has (" start ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( start . format ( DateTime Formatter . ISO _ LOCAL _ DATE ), Ġdate . getString (" start ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( date . has (" end ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( end . format ( DateTime Formatter . ISO _ LOCAL _ DATE ), Ġdate . getString (" end ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġdate Ġtime Ġmention `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnow Ġ= ĠOffset DateTime . now () ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠM ention Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdate ( now ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" mention ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" mention ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġmention Ġ= Ġjson . getObject (" mention ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" type ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" date ", Ġmention . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" date ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġdate Ġ= Ġmention . getObject (" date ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( date . has (" start ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( now . format ( DateTime Formatter . ISO _ OFFSET _ DATE _ TIME ), Ġdate . getString (" start ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Method Source (" net . ad ri ant od t . not ion api . tests . building . richt ext . Rich Text Params Kt # all Combin ations ") ĊĠĠĠ Ġfun Ġ` build Ġdate Ġtime Ġrange Ġmention `( params : ĠRich Text Params ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstart Ġ= ĠOffset DateTime . now () ĊĠĠĠĠĠĠĠ Ġval Ġend Ġ= Ġstart . plus Hours ( 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġjson Ġ= ĠM ention Builder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdate ( start , Ġend ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapply Params ( params ) ĊĠĠĠĠĠĠĠ Ġ}. toJson () ĊĊĠĠĠĠĠĠĠ Ġassert Params ( params , Ġjson . getObject (" annotations ")) ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" mention ", Ġjson . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( json . has (" mention ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġmention Ġ= Ġjson . getObject (" mention ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" type ")) ĊĠĠĠĠĠĠĠ ĠassertEquals (" date ", Ġmention . getString (" type ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( mention . has (" date ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġdate Ġ= Ġmention . getObject (" date ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( date . has (" start ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( start . format ( DateTime Formatter . ISO _ OFFSET _ DATE _ TIME ), Ġdate . getString (" start ")) ĊĠĠĠĠĠĠĠ ĠassertTrue ( date . has (" end ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( end . format ( DateTime Formatter . ISO _ OFFSET _ DATE _ TIME ), Ġdate . getString (" end ")) ĊĠĠĠ Ġ} Ċ } ĊĊ