### Question:
MavenDependencyResolver implements DependencyResolver { @Override public Map<IArtifactMetadata, Path> getProjectDependencies(boolean transitive, ResolutionScope scope) { return resolveDependencies(scope, transitive); } MavenDependencyResolver(MavenProject project, RepositorySystemSession repoSession,
      RepositorySystem repositorySystem, ScopedProjectDependencyCache dependencyCache); @Override Map.Entry<IArtifactMetadata, Path> getProjectDependency(String groupId, String artifactId,
      String classifier, ResolutionScope scope); @Override Map<IArtifactMetadata, Path> getProjectDependencies(boolean transitive,
      ResolutionScope scope);  }### Answer:
@Test public void testResolveAllCompileDependencies() throws Exception { setup("all-compile"); Map<IArtifactMetadata, Path> resolved = resolver.getProjectDependencies(true, ResolutionScope.COMPILE); assertThat(resolved).containsValue(jarfile.toPath()); assertThat(resolved).containsValue(dirfiledirect.toPath()); assertThat(resolved).containsValue(dirfiletransitive.toPath()); }
@Test public void testResolveDirectDependencies() throws Exception { setup("all-compile"); Map<IArtifactMetadata, Path> resolved = resolver.getProjectDependencies(false, ResolutionScope.COMPILE); assertThat(resolved).containsValue(jarfile.toPath()); assertThat(resolved).containsValue(dirfiledirect.toPath()); assertThat(resolved).doesNotContainValue(dirfiletransitive.toPath()); }
@Test public void testTestScopeNotResolved() throws Exception { setup("mixed-scope"); Map<IArtifactMetadata, Path> resolved = resolver.getProjectDependencies(false, ResolutionScope.COMPILE); assertThat(resolved).doesNotContainValue(jarfile.toPath()); assertThat(resolved).containsValue(dirfiledirect.toPath()); }
@Test public void testTestScopeResolvesCompileScope() throws Exception { setup("mixed-scope"); Map<IArtifactMetadata, Path> resolved = resolver.getProjectDependencies(false, ResolutionScope.TEST); assertThat(resolved).containsValue(jarfile.toPath()); assertThat(resolved).containsValue(dirfiledirect.toPath()); }