package Ġcom . jame skb ride . code m ash comp anion . application Ċ Ċ import Ġcom . jame skb ride . code m ash comp anion . data . Conference Repository Ċ import Ġcom . jame skb ride . code m ash comp anion . injection . Application Component Ċ import Ġcom . jame skb ride . code m ash comp anion . network . service . Code m ash Service Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mockito .* Ċ Ċ class ĠCode m ash Companion Application Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġcode m ash Service : ĠCode m ash Service ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġconference Repository : ĠConference Repository ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġapplication Component Factory : ĠApplication Component Factory ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġapplication Component : ĠApplication Component ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġsubject : ĠCode m ash Companion Application ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġcode m ash Service Ġ= Ġmock ( Code m ash Service :: class . java ) ĊĠĠĠĠĠĠĠ Ġconference Repository Ġ= Ġmock ( Conference Repository :: class . java ) ĊĠĠĠĠĠĠĠ Ġapplication Component Factory Ġ= Ġmock ( Application Component Factory :: class . java ) ĊĠĠĠĠĠĠĠ Ġapplication Component Ġ= Ġmock ( Application Component :: class . java ) ĊĊĊĠĠĠĠĠĠĠ Ġsubject Ġ= ĠCode m ash Companion Application ( application Component Factory ) ĊĠĠĠĠĠĠĠ Ġsubject . conference Repository Ġ= Ġconference Repository ĊĠĠĠĠĠĠĠ Ġsubject . code m ash Service Ġ= Ġcode m ash Service ĊĊĠĠĠĠĠĠĠ Ġ` when `( application Component Factory . build ( subject )). thenReturn ( application Component ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠonCreate It Inject s Dependencies () Ġ{ ĊĠĠĠĠĠĠĠ Ġsubject . configure () ĊĊĠĠĠĠĠĠĠ Ġverify ( application Component Factory ). build ( subject ) ĊĠĠĠĠĠĠĠ Ġverify ( application Component ). inject ( subject ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠonCreate It Open s The Code m ash Service () Ġ{ ĊĠĠĠĠĠĠĠ Ġsubject . configure () ĊĊĠĠĠĠĠĠĠ Ġverify ( code m ash Service ). open () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠonCreate It Open s The Conference Repository () Ġ{ ĊĠĠĠĠĠĠĠ Ġsubject . configure () ĊĊĠĠĠĠĠĠĠ Ġverify ( conference Repository ). open () ĊĠĠĠ Ġ} Ċ }