@Test
public void testCopyWithResolvedDependency() {

  FileStub binaryPath = new FileStub("fake.jar", true);
  FileStub sourcePath = new FileStub("fake-src.jar", true);
  FileStub javadocPath = new FileStub("fake-javadoc.jar", true);
  IdeaDependencyScope scope = mock(IdeaDependencyScope.class);
  GradleModuleVersion moduleVersion = new GradleModuleVersionImpl(myModuleVersion);
  when(myOriginalDependency.getFile()).thenReturn(binaryPath);
  when(myOriginalDependency.getSource()).thenReturn(sourcePath);
  when(myOriginalDependency.getJavadoc()).thenReturn(javadocPath);
  when(myOriginalDependency.getScope()).thenReturn(scope);
  when(myOriginalDependency.getGradleModuleVersion()).thenReturn(moduleVersion);
  when(scope.getScope()).thenReturn("compile");
  JarLibraryDependency dependency = myIdeaJarLibraryDependencyFactory.create(myOriginalDependency);
  assertNotNull(dependency);
  assertEquals("fake", dependency.getName());
  assertEquals("compile", dependency.getScope());
  assertSame(binaryPath, dependency.getBinaryPath());
  assertSame(sourcePath, dependency.getSourcePath());
  assertSame(javadocPath, dependency.getJavadocPath());
  assertEquals(moduleVersion, dependency.getModuleVersion());
  assertTrue(dependency.isResolved());
}