package Ġcom . applic aster . ui . loaders Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . applic aster . ui . activities . MainActivity Ċ import Ġcom . applic aster . ui . loaders . MainActivity Pre load Sequence . configure Ċ import Ġcom . applic aster . util . AP Logger Ċ import Ġcom . applic aster . z app . quick brick . loader . DataLoader Ċ import Ġio . reactivex . Comp letable Ċ import Ġio . reactivex . schedul ers . Schedulers Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . power mock . api . mockito . Power Mockito Ċ import Ġorg . power mock . core . class loader . annotations . Prepare For Test Ċ import Ġorg . power mock . modules . junit 4 . Power Mock Runner Ċ Ċ @ RunWith ( Power Mock Runner :: class ) Ċ @ Prepare For Test ( MainActivity :: class , ĠDataLoader :: class , ĠAP Logger :: class ) Ċ class ĠMainActivity Pre load Sequence Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġreachable Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġactivity Ġ= ĠPower Mockito . mock ( MainActivity :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠPower Mockito . mock ( Context :: class . java ) ĊĊĠĠĠĠĠĠĠ ĠPower Mockito . mock Static ( DataLoader :: class . java ) ĊĠĠĠĠĠĠĠ ĠPower Mockito . mock Static ( AP Logger :: class . java ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġfake Ġcontext ĊĠĠĠĠĠĠĠ ĠPower Mockito .` when `( activity . application Context ). thenReturn ( context ) ĊĊĠĠĠĠĠĠĠ Ġ// actual Ġsteps ĊĠĠĠĠĠĠĠ ĠPower Mockito .` when `( activity . play Video Intro If Present ()). thenReturn ( Comp letable . complete ()) ĊĠĠĠĠĠĠĠ ĠPower Mockito .` when `( activity . execute Hooks ( false )). thenReturn ( Comp letable . complete ()) ĊĠĠĠĠĠĠĠ ĠPower Mockito .` when `( DataLoader . initialize ( activity . application Context )). thenReturn ( Comp letable . complete ()) ĊĠĠĠĠĠĠĠ ĠPower Mockito .` when `( activity . execute Hooks ( true )). thenReturn ( Comp letable . complete ()) ĊĠĠĠĠĠĠĠ ĠPower Mockito .` when `( activity . initialize U IL ayer ()). thenReturn ( Comp letable . complete ()) ĊĠĠĠĠĠĠĠ ĠPower Mockito .` when `( activity . execute Consent Hooks ()). thenReturn ( Comp letable . complete ()) ĊĠĠĠĠĠĠĠ ĠPower Mockito .` when `( activity . show UI ()). thenReturn ( Comp letable . complete ()) ĊĊĠĠĠĠĠĠĠ Ġval Ġpre loader Ġ= Ġconfigure ( activity , ĠS chedulers . tr amp oline ()) ĊĠĠĠĠĠĠĠ Ġpre loader . run () ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( pre loader . complete ()) ĊĠĠĠ Ġ} Ċ }