package Ġorg . cc ci . g to . android . common . ok ta . oidc . net . response Ċ Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġcom . ok ta . oidc . net . response . UserInfo Ċ import Ġorg . cc ci . g to . android . common . base . Time Constants . DAY _ IN _ MS Ċ import Ġorg . cc ci . g to . android . common . base . Time Constants . HOUR _ IN _ MS Ċ import Ġorg . cc ci . g to . android . common . base . Time Constants . WEEK _ IN _ MS Ċ import Ġorg . junit . Assert . assertFalse Ċ import Ġorg . junit . Assert . assertTrue Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠPers ist able UserInfo Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġverify Next Refresh Delay () Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠuserInfo Ġ= ĠPers ist able UserInfo ("", ĠUserInfo ( null )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( DAY _ IN _ MS , ĠuserInfo . next Refresh Delay , Ġ 1 0 0 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġverify Is St ale () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertFalse ( userInfo ( System . currentTimeMillis () Ġ- ĠHO UR _ IN _ MS ). is St ale ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( userInfo ( System . currentTimeMillis () Ġ- ĠW EEK _ IN _ MS ). is St ale ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠuserInfo ( retrie ved At : ĠLong ) Ġ= ĠPers ist able UserInfo ("", ĠUserInfo ( null ), Ġretrieved At ) ĊĊĠĠĠ Ġprivate Ġfun ĠassertEquals ( expected : ĠLong , Ġactual : ĠLong , Ġdelta : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ ĠassertTrue ( actual Ġ>= Ġexpected Ġ- Ġdelta ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( actual Ġ<= Ġexpected Ġ+ Ġdelta ) ĊĠĠĠ Ġ} Ċ } Ċ