package Ġuk . n hs . n hs x . covid 1 9 . android . app . on boarding Ċ Ċ import Ġandroidx . arch . core . executor . testing . Instant Task Executor Rule Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġio . mock k . verify Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . analytics . Submit On boarding Analytics Worker Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . analytics . Submitted On boarding Analytics Provider Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . battery . Battery Optimization Required Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . common . Periodic Tasks Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . on boarding . Permission ViewModel . Navigation Target Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . on boarding . Permission ViewModel . Navigation Target . B ATTER Y _ OPTIMI Z ATION Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . on boarding . Permission ViewModel . Navigation Target . STATUS _ ACTIVITY Ċ Ċ class ĠPermission ViewModel Test Ġ{ ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġinstant Task Executor Rule Ġ= ĠInstant Task Executor Rule () ĊĊĠĠĠ Ġprivate Ġval Ġon boarding Completed Provider Ġ= Ġmock k < On boarding Completed Provider >( relax ed Ġ= Ġtrue ) ĊĠĠĠ Ġprivate Ġval Ġsubmit Analytics Worker Scheduler Ġ= ĊĠĠĠĠĠĠĠ Ġmock k < Submit On boarding Analytics Worker . Scheduler >( relax ed Ġ= Ġtrue ) ĊĠĠĠ Ġprivate Ġval Ġperiodic Tasks Ġ= Ġmock k < Periodic Tasks >( relax ed Ġ= Ġtrue ) ĊĠĠĠ Ġprivate Ġval Ġbattery Optimization Required Ġ= Ġmock k < Battery Optimization Required >() ĊĠĠĠ Ġprivate Ġval Ġsubmitted On boarding Analytics Provider Ġ= Ġmock k < Submitted On boarding Analytics Provider >( relax ed Ġ= Ġtrue ) ĊĊĠĠĠ Ġprivate Ġval Ġtest Subject Ġ= ĊĠĠĠĠĠĠĠ ĠPermission ViewModel ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon boarding Completed Provider , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsubmit Analytics Worker Scheduler , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġperiodic Tasks , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbattery Optimization Required , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsubmitted On boarding Analytics Provider ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġval Ġon Activity Navigation Observer Ġ= Ġmock k < Observer < Navigation Target >>( relax ed Ġ= Ġtrue ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` on Ġactivity Ġnavigation Ġand Ġbattery Ġoptimization Ġrequired Ġshould Ġfire Ġbattery Ġoptimization Ġand Ġsend Ġon boarding Ġanalytics `() Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Subject . on Activity Navigation (). observe Fore ver ( on Activity Navigation Observer ) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġbattery Optimization Required () Ġ} Ġreturns Ġtrue ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġsubmitted On boarding Analytics Provider . value Ġ} Ġreturns Ġnull ĊĊĠĠĠĠĠĠĠ Ġtest Subject . on Exposure Notifications Active () ĊĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġon boarding Completed Provider Ġset Property Ġ" value " Ġvalue Ġeq ( true ) Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġsubmit Analytics Worker Scheduler . schedule On boarding Analytics Event () Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġsubmitted On boarding Analytics Provider Ġset Property Ġ" value " Ġvalue Ġeq ( true ) Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġperiodic Tasks . schedule () Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġon Activity Navigation Observer . on Changed ( B ATTER Y _ OPTIMI Z ATION ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` on Ġactivity Ġnavigation Ġand Ġbattery Ġoptimization Ġrequired Ġshould Ġfire Ġbattery Ġoptimization Ġwithout Ġsending Ġon boarding Ġanalytics `() Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Subject . on Activity Navigation (). observe Fore ver ( on Activity Navigation Observer ) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġbattery Optimization Required () Ġ} Ġreturns Ġtrue ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġsubmitted On boarding Analytics Provider . value Ġ} Ġreturns Ġtrue ĊĊĠĠĠĠĠĠĠ Ġtest Subject . on Exposure Notifications Active () ĊĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġon boarding Completed Provider Ġset Property Ġ" value " Ġvalue Ġeq ( true ) Ġ} ĊĠĠĠĠĠĠĠ Ġverify ( exact ly Ġ= Ġ 0 ) Ġ{ Ġsubmit Analytics Worker Scheduler . schedule On boarding Analytics Event () Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġperiodic Tasks . schedule () Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġon Activity Navigation Observer . on Changed ( B ATTER Y _ OPTIMI Z ATION ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` on Ġactivity Ġnavigation Ġand Ġbattery Ġoptimization Ġnot Ġrequired Ġshould Ġfire Ġstatus Ġactivity Ġwithout Ġsending Ġon boarding Ġanalytics `() Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Subject . on Activity Navigation (). observe Fore ver ( on Activity Navigation Observer ) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġbattery Optimization Required () Ġ} Ġreturns Ġfalse ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġsubmitted On boarding Analytics Provider . value Ġ} Ġreturns Ġtrue ĊĊĠĠĠĠĠĠĠ Ġtest Subject . on Exposure Notifications Active () ĊĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġon boarding Completed Provider Ġset Property Ġ" value " Ġvalue Ġeq ( true ) Ġ} ĊĠĠĠĠĠĠĠ Ġverify ( exact ly Ġ= Ġ 0 ) Ġ{ Ġsubmit Analytics Worker Scheduler . schedule On boarding Analytics Event () Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġperiodic Tasks . schedule () Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġon Activity Navigation Observer . on Changed ( STATUS _ ACTIVITY ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` on Ġactivity Ġnavigation Ġand Ġbattery Ġoptimization Ġnot Ġrequired Ġshould Ġfire Ġstatus Ġactivity Ġand Ġsend Ġon boarding Ġanalytics `() Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Subject . on Activity Navigation (). observe Fore ver ( on Activity Navigation Observer ) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġbattery Optimization Required () Ġ} Ġreturns Ġfalse ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġsubmitted On boarding Analytics Provider . value Ġ} Ġreturns Ġfalse ĊĊĠĠĠĠĠĠĠ Ġtest Subject . on Exposure Notifications Active () ĊĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġon boarding Completed Provider Ġset Property Ġ" value " Ġvalue Ġeq ( true ) Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġsubmit Analytics Worker Scheduler . schedule On boarding Analytics Event () Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġsubmitted On boarding Analytics Provider Ġset Property Ġ" value " Ġvalue Ġeq ( true ) Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġperiodic Tasks . schedule () Ġ} ĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġon Activity Navigation Observer . on Changed ( STATUS _ ACTIVITY ) Ġ} ĊĠĠĠ Ġ} Ċ } Ċ