package Ġcom . art uro g ut ier rez . op enticator . domain . bootstrap Ċ Ċ import Ġcom . art uro g ut ier rez . op enticator . storage . database . Database Configurator Ċ import Ġcom . art uro g ut ier rez . op enticator . storage . preferences . Preferences Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito .` when ` Ċ import Ġorg . mockito . Mockito . verify Ċ import Ġorg . mockito . Mockito Annotations Ċ Ċ class ĠStorage Initial iz ator Test Ġ{ ĊĠ Ġ@ Mock ĊĠ Ġprivate Ġlateinit Ġvar Ġmock Preferences : ĠPreferences ĊĠ Ġ@ Mock ĊĠ Ġprivate Ġlateinit Ġvar Ġmock Database Configurator : ĠDatabase Configurator ĊĊĠ Ġprivate Ġlateinit Ġvar Ġstorage Initial iz ator : ĠStorage Initial iz ator ĊĊĠ Ġ@ Before ĊĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĊĠĠĠ Ġstorage Initial iz ator Ġ= ĠStorage Initial iz ator ( mock Preferences , Ġmock Database Configurator ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Initializing Database With Password From Preferences () Ġ{ ĊĠĠĠ Ġ` when `< String >( mock Preferences . master Password ). thenReturn (" password ") ĊĊĠĠĠ Ġstorage Initial iz ator . configure Storage () ĊĊĠĠĠ Ġverify < Database Configurator >( mock Database Configurator ). configure (" password ") ĊĠ Ġ} Ċ } Ċ