package Ġcom . rap ids os . em ergency datas dk Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . github . rto shiro . secure . Secure SharedPreferences Ċ import Ġcom . rap ids os . em ergency datas dk . internal . helpers . dependency _ injection . modules . E mg Data Preferences Module Ċ import Ġcom . rap ids os . em ergency datas dk . internal . preferences . E mg Data Preferences Ċ import Ġorg . mockito . Mockito Ċ Ċ /** Ċ Ġ* Ġ@ author ĠJ os ias ĠS ena Ċ Ġ*/ Ċ internal Ġclass ĠMock E mg Data Preferences Module ( context : ĠContext ) Ġ: ĠE mg Data Preferences Module ( context ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġprovides Secure SharedPreferences (): ĠSecure SharedPreferences Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsecure SharedPreferences Ġ= ĠMockito . mock ( Secure SharedPreferences :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġeditor Ġ= ĠMockito . mock ( Secure SharedPreferences . Editor :: class . java ) ĊĊĠĠĠĠĠĠĠ ĠMockito .` when `( secure SharedPreferences . edit ()). thenReturn ( editor ) ĊĊĠĠĠĠĠĠĠ ĠMockito .` when `( editor . putString ( Mockito . any String (), ĠMockito . any String ())). thenReturn ( editor ) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġsecure SharedPreferences ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġprovides Rain Preferences ( preferences : ĠSecure SharedPreferences ): ĠE mg Data Preferences Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠMockito . mock ( E mg Data Preferences :: class . java ) ĊĠĠĠ Ġ} Ċ Ċ }