Promise<Void> (Module module) { ExternalLibraryDescriptor descriptor = getFrameworkLibraryDescriptor(); if (descriptor != null) { return JavaProjectModelModificationService.getInstance(module.getProject()).addDependency(module, descriptor, DependencyScope.TEST); } else { String path = getLibraryPath(); if (path != null) { OrderEntryFix.addJarsToRoots(Collections.singletonList(path), null, module, null); return Promises.resolvedPromise(null); } } return Promises.rejectedPromise(); }