package Ġpl . m ich ol Ċ Ċ import Ġorg . junit . Assert Ċ import Ġpl . m ich ol . cache . CacheManager Ċ import Ġpl . m ich ol . cache . models . Simple Cache Config Ċ import Ġjava . math . BigDecimal Ċ import Ġkotlin . test . Test Ċ Ċ class ĠCache Manager Tests Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġone Cache Instance Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcache Manager : ĠCache Manager Ġ= ĠCache Manager () ĊĠĠĠĠĠĠĠ Ġcache Manager . create Cache (" test Cache ", ĠSimple Cache Config ( key Class Ġ= ĠInt :: class . java , Ġvalue Class Ġ= ĠString :: class . java )) ĊĠĠĠĠĠĠĠ Ġcache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠString :: class . java ) !!. put Cache Entry ( 1 , Ġ" 2 ") ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals (" 2 ", Ġcache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠString :: class . java ) !!. getCache Entry ( 1 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġmultiply Cache Instance Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcache Manager : ĠCache Manager Ġ= ĠCache Manager () ĊĠĠĠĠĠĠĠ Ġcache Manager . create Cache (" test Cache ", ĠSimple Cache Config ( key Class Ġ= ĠInt :: class . java , Ġvalue Class Ġ= ĠString :: class . java )) ĊĠĠĠĠĠĠĠ Ġcache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠString :: class . java ) !!. put Cache Entry ( 1 , Ġ" 2 ") ĊĊĠĠĠĠĠĠĠ Ġcache Manager . create Cache (" test Cache 2 ", ĠSimple Cache Config ( key Class Ġ= ĠString :: class . java , Ġvalue Class Ġ= ĠBigDecimal :: class . java )) ĊĠĠĠĠĠĠĠ Ġcache Manager . getCache (" test Cache 2 ", ĠString :: class . java , ĠBigDecimal :: class . java ) !!. put Cache Entry (" 1 ", ĠBigDecimal . valueOf ( 1 0 )) ĊĊĠĠĠĠĠĠĠ ĠAssert . assertEquals (" 2 ", Ġcache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠString :: class . java ) !!. getCache Entry ( 1 )) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( 1 0 , Ġcache Manager . getCache (" test Cache 2 ", ĠString :: class . java , ĠBigDecimal :: class . java ) !!. getCache Entry (" 1 ") !!. intValue Exact ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġremove Cache Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcache Manager : ĠCache Manager Ġ= ĠCache Manager () ĊĠĠĠĠĠĠĠ Ġcache Manager . create Cache (" test Cache ", ĠSimple Cache Config ( key Class Ġ= ĠInt :: class . java , Ġvalue Class Ġ= ĠString :: class . java )) ĊĠĠĠĠĠĠĠ Ġcache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠString :: class . java ) !!. put Cache Entry ( 1 , Ġ" 2 ") ĊĊĠĠĠĠĠĠĠ Ġcache Manager . create Cache (" test Cache 2 ", ĠSimple Cache Config ( key Class Ġ= ĠString :: class . java , Ġvalue Class Ġ= ĠBigDecimal :: class . java )) ĊĠĠĠĠĠĠĠ Ġcache Manager . getCache (" test Cache 2 ", ĠString :: class . java , ĠBigDecimal :: class . java ) !!. put Cache Entry (" 1 ", ĠBigDecimal . valueOf ( 1 0 )) ĊĊĠĠĠĠĠĠĠ ĠAssert . assertEquals (" 2 ", Ġcache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠString :: class . java ) !!. getCache Entry ( 1 )) ĊĊĠĠĠĠĠĠĠ Ġcache Manager . remove Cache (" test Cache 2 ") ĊĠĠĠĠĠĠĠ ĠAssert . assertNull ( cache Manager . getCache (" test Cache ", ĠString :: class . java , ĠBigDecimal :: class . java )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Invalid KeyType Cache () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcache Manager : ĠCache Manager Ġ= ĠCache Manager () ĊĠĠĠĠĠĠĠ Ġcache Manager . create Cache (" test Cache ", ĠSimple Cache Config ( key Class Ġ= ĠInt :: class . java , Ġvalue Class Ġ= ĠString :: class . java )) ĊĠĠĠĠĠĠĠ Ġcache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠString :: class . java ) !!. put Cache Entry ( 1 , Ġ" 2 ") ĊĊĠĠĠĠĠĠĠ ĠAssert . assertNull ( cache Manager . getCache (" test Cache ", ĠString :: class . java , ĠString :: class . java )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Invalid valueType Cache () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcache Manager : ĠCache Manager Ġ= ĠCache Manager () ĊĠĠĠĠĠĠĠ Ġcache Manager . create Cache (" test Cache ", ĠSimple Cache Config ( key Class Ġ= ĠInt :: class . java , Ġvalue Class Ġ= ĠString :: class . java )) ĊĠĠĠĠĠĠĠ Ġcache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠString :: class . java ) !!. put Cache Entry ( 1 , Ġ" 2 ") ĊĊĠĠĠĠĠĠĠ ĠAssert . assertNull ( cache Manager . getCache (" test Cache ", ĠInt :: class . java , ĠInt :: class . java )) ĊĠĠĠ Ġ} Ċ Ċ }