Remove LruCache when running Instrumentation tests using Espresso

135 views Asked by At

I am running espresso tests and want to remove the LruCache on each test run.

I am able to do so for preferences:

    @Before
    @After
    public void clearSharedPrefs() {
        SharedPreferences settings = loginActivityActivityTestRule.getActivity().getSharedPreferences(Constants.PREF_NAME, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = settings.edit();
        editor.clear();
        editor.commit();
    }

Please let me know how can I do the same for LruCache?

0

There are 0 answers