void () { final JpsModule module = myProject.addModule("m", JpsJavaModuleType.INSTANCE); final JpsLibrary library = myProject.addLibrary("l", JpsJavaLibraryType.INSTANCE); final JpsLibraryDependency dependency = module.getDependenciesList().addLibraryDependency(library); getJavaService().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.TEST); getJavaService().getOrCreateDependencyExtension(dependency).setExported(true); List<JpsDependencyElement> dependencies = assertOneElement(myProject.getModules()).getDependenciesList().getDependencies(); assertEquals(2, dependencies.size()); final JpsDependencyElement dep = dependencies.get(1); final JpsJavaDependencyExtension extension = getJavaService().getDependencyExtension(dep); assertNotNull(extension); assertTrue(extension.isExported()); assertSame(JpsJavaDependencyScope.TEST, extension.getScope()); }