package Ġcom . world pay . access . checkout . session Ċ Ċ import Ġandroidx . lifecycle . Lifecycle Owner Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . given Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . mock Ċ import Ġcom . world pay . access . checkout . session . broadcast . Session Broadcast ManagerFactory Ċ import Ġjunit . framework . Assert . assertNotNull Ċ import Ġorg . junit . Test Ċ Ċ class ĠActivity Lifecycle Observer Initial iser Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġreturn Ġan Ġactivity Ġlifecycle Ġobserver Ġinitial iser Ġwhen Ġinitialise Ġis Ġcalled `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlifecycle Owner Ġ= Ġmock < Lifecycle Owner >() ĊĠĠĠĠĠĠĠ Ġval Ġsession Broadcast ManagerFactory Ġ= Ġmock < Session Broadcast ManagerFactory >() ĊĊĠĠĠĠĠĠĠ Ġgiven ( lifecycle Owner . lifecycle ). willReturn ( mock ()) ĊĠĠĠĠĠĠĠ Ġgiven ( session Broadcast ManagerFactory . create Instance ()). willReturn ( mock ()) ĊĊĠĠĠĠĠĠĠ Ġval Ġactivity Lifecycle Observer Initial iser Ġ= ĠActivity Lifecycle Observer Initial iser ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" tag ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlifecycle Owner , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsession Broadcast ManagerFactory ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġval Ġobserver Ġ= Ġactivity Lifecycle Observer Initial iser . initial ise () ĊĊĠĠĠĠĠĠĠ ĠassertNotNull ( observer ) ĊĠĠĠ Ġ} Ċ } Ċ