1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.aether.internal.impl.collect;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24 import org.eclipse.aether.artifact.DefaultArtifact;
25 import org.eclipse.aether.graph.DefaultDependencyNode;
26 import org.eclipse.aether.graph.Dependency;
27 import org.eclipse.aether.graph.DependencyCycle;
28 import org.eclipse.aether.graph.DependencyNode;
29 import org.junit.Test;
30
31 import static org.junit.Assert.assertEquals;
32
33 public class DefaultDependencyCycleTest {
34 private static final Dependency FOO_DEPENDENCY = new Dependency(new DefaultArtifact("group-id:foo:1.0"), "test");
35 private static final Dependency BAR_DEPENDENCY = new Dependency(new DefaultArtifact("group-id:bar:1.0"), "test");
36
37 @Test
38 public void testToString() {
39 List<DependencyNode> nodes = new ArrayList<>();
40 nodes.add(new DefaultDependencyNode(FOO_DEPENDENCY));
41 DependencyCycle cycle = new DefaultDependencyCycle(nodes, 1, BAR_DEPENDENCY);
42
43 assertEquals("group-id:foo:jar -> group-id:bar:jar", cycle.toString());
44 }
45 }