@Test public void testThatTwoModulesCanBeInstalled() throws IOException { Mockito.when(mModulePathsNo1Mock.containsDexFile()).thenReturn(true); Mockito.when(mModulePathsNo1Mock.getDexFile()).thenReturn(mDexFileNo1Mock); Mockito.when(mModulePathsNo1Mock.getOptimizedDexFile()).thenReturn(mOptDexFileNo1Mock); Mockito.when(mModulePathsNo2Mock.containsDexFile()).thenReturn(true); Mockito.when(mModulePathsNo2Mock.getDexFile()).thenReturn(mDexFileNo2Mock); Mockito.when(mModulePathsNo2Mock.getOptimizedDexFile()).thenReturn(mOptDexFileNo2Mock); mObjectUnderTest.installModule(MODULE_NAME_NO1); mObjectUnderTest.installModule(MODULE_NAME_NO2); Mockito.verify(mCustomClassLoaderMock) .addDex(Mockito.eq(mDexFileNo1Mock), Mockito.eq(mOptDexFileNo1Mock)); Mockito.verify(mCustomClassLoaderMock) .addDex(Mockito.eq(mDexFileNo2Mock), Mockito.eq(mOptDexFileNo2Mock)); Mockito.verify(mLazyLoadListenerMock, Mockito.times(1)) .moduleLazilyInstalled(Mockito.eq(MODULE_NAME_NO1), Mockito.anyLong()); Mockito.verify(mLazyLoadListenerMock, Mockito.times(1)) .moduleLazilyInstalled(Mockito.eq(MODULE_NAME_NO2), Mockito.anyLong()); }
public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); }
LazyModuleLoader { public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); } }
LazyModuleLoader { public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); }
LazyModuleLoader { public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); synchronized ServiceLike loadServiceModule(String moduleName, String className); synchronized SupportFragmentLike loadSupportFragmentModule(
      Fragment hostingFragment, String moduleName, String className); synchronized FragmentLike loadFragmentModule(
      android.app.Fragment hostingFragment, String moduleName, String className); synchronized ActivityLike loadActivityModule(
      Activity activity, String moduleName, String className); synchronized Class loadModule(String moduleName, String className); synchronized void installModule(String moduleName); }
LazyModuleLoader { public synchronized void installModule(String moduleName) throws IOException { mLoaderAlgorithm.installModule(moduleName); } LazyModuleLoader(Context context, LoaderAlgorithm loaderAlgorithm); synchronized ServiceLike loadServiceModule(String moduleName, String className); synchronized SupportFragmentLike loadSupportFragmentModule(
      Fragment hostingFragment, String moduleName, String className); synchronized FragmentLike loadFragmentModule(
      android.app.Fragment hostingFragment, String moduleName, String className); synchronized ActivityLike loadActivityModule(
      Activity activity, String moduleName, String className); synchronized Class loadModule(String moduleName, String className); synchronized void installModule(String moduleName);  }