use of com.android.tools.idea.gradle.project.sync.ExpectedModuleDependency in project android by JetBrains.
the class DependenciesModuleSetupStepTest method testSetUpModuleDependency.
public void testSetUpModuleDependency() {
String moduleName = "lib";
// This is the module to add as dependency.
Module libModule = createModule(moduleName);
JavaModuleDependency moduleDependency = new JavaModuleDependency(moduleName, "compile", true);
Collection<JavaModuleDependency> moduleDependencies = new ArrayList<>();
moduleDependencies.add(moduleDependency);
// We only want module dependencies
when(myJavaModuleModel.getJavaModuleDependencies()).thenReturn(moduleDependencies);
when(myJavaModuleModel.getJarLibraryDependencies()).thenReturn(Collections.emptyList());
Module mainModule = getModule();
mySetupStep.setUpModule(mainModule, myModelsProvider, myJavaModuleModel, null, null);
// needed to check if the module dependency was added.
ApplicationManager.getApplication().runWriteAction(() -> myModelsProvider.commit());
// See https://code.google.com/p/android/issues/detail?id=225923
ExpectedModuleDependency expected = new ExpectedModuleDependency(libModule, COMPILE, true);
assertAbout(moduleDependencies()).that(mainModule).contains(expected);
}
Aggregations