@Test public void testAlts_exclusionElements() { Correspondence<DependencyPath, String> dependencyPathToString = Correspondence.transforming(DependencyPath::toString, "has string representation"); DefaultArtifact artifact = new DefaultArtifact("io.grpc:grpc-alts:jar:1.27.0"); DependencyGraph graph = dependencyGraphBuilder .buildFullDependencyGraph(ImmutableList.of(artifact)); List<DependencyPath> dependencyPaths = graph.list(); String expectedDependencyPathForOpencensusContribHttpUtil = "io.grpc:grpc-alts:jar:1.27.0 " + "/ com.google.auth:google-auth-library-oauth2-http:0.19.0 (compile) " + "/ com.google.http-client:google-http-client:1.33.0 (compile) " + "/ io.opencensus:opencensus-contrib-http-util:0.24.0 (compile)"; Truth.assertThat(dependencyPaths) .comparingElementsUsing(dependencyPathToString) .contains(expectedDependencyPathForOpencensusContribHttpUtil); String unexpectedDependencyPathForGuava = expectedDependencyPathForOpencensusContribHttpUtil + " / com.google.guava:guava:jar:26.0-android (compile)"; Truth.assertThat(dependencyPaths) .comparingElementsUsing(dependencyPathToString) .doesNotContain(unexpectedDependencyPathForGuava); }
public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); }
DependencyGraphBuilder { public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); } }
DependencyGraphBuilder { public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); } DependencyGraphBuilder();  DependencyGraphBuilder(Iterable<String> mavenRepositoryUrls); }
DependencyGraphBuilder { public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); } DependencyGraphBuilder();  DependencyGraphBuilder(Iterable<String> mavenRepositoryUrls); DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(Artifact artifact); DependencyGraph buildMavenDependencyGraph(Dependency dependency); }
DependencyGraphBuilder { public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); } DependencyGraphBuilder();  DependencyGraphBuilder(Iterable<String> mavenRepositoryUrls); DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(Artifact artifact); DependencyGraph buildMavenDependencyGraph(Dependency dependency);  }