Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asafambar committed Dec 28, 2023
1 parent 337b2b6 commit ad9f0f7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/test/java/com/jfrog/mavendeptree/UtilsTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ public class UtilsTests {

@Test
public void testPopulateDependencyMapNoChildren() {
DependencyNode root = createDependency("root-group", "root-artifact", "root-version", null,"");
DependencyNode root = createDependency("root-group", "root-artifact", "root-version", null, "");
runPopulateDependencyMap(root, 1);
}

@Test
public void testPopulateDependencyMapDuplicateChildren() {
DefaultDependencyNode root = createDependency("root-group", "root-artifact", "root-version", null,"");
DefaultDependencyNode root = createDependency("root-group", "root-artifact", "root-version", null, "");

// Root's children
DefaultDependencyNode firstChild = createDependency("child1-group", "child1-artifact", "child1-version", "scope1","");
DefaultDependencyNode secondChild = createDependency("child2-group", "child2-artifact", "child2-version", "scope2","type2");
DefaultDependencyNode firstChild = createDependency("child1-group", "child1-artifact", "child1-version", "scope1", "");
DefaultDependencyNode secondChild = createDependency("child2-group", "child2-artifact", "child2-version", "scope2", "type2");
root.setChildren(Lists.newArrayList(firstChild, secondChild));

// First child's children
DefaultDependencyNode thirdChild = createDependency("child3-group", "child3-artifact", "child3-version", "scope3","");
DefaultDependencyNode secondsChildWithOtherScope = createDependency("child2-group", "child2-artifact", "child2-version", "other-scope","other-type");
DefaultDependencyNode thirdChild = createDependency("child3-group", "child3-artifact", "child3-version", "scope3", "");
DefaultDependencyNode secondsChildWithOtherScope = createDependency("child2-group", "child2-artifact", "child2-version", "other-scope", "other-type");

firstChild.setChildren(Lists.newArrayList(secondsChildWithOtherScope, thirdChild));

Expand All @@ -65,16 +65,16 @@ public void testPopulateDependencyMapDuplicateChildren() {

@Test
public void testGetNodeId() {
Artifact artifact = createArtifact("group", "artifact", "1.0.0", "scope","");
Artifact artifact = createArtifact("group", "artifact", "1.0.0", "scope", "");
assertEquals(getGavString(artifact), "group:artifact:1.0.0");
}

private Artifact createArtifact(String groupId, String artifactId, String version, String scope, String type) {
return new DefaultArtifact(groupId, artifactId, version, scope, type, "", null);
}

private DefaultDependencyNode createDependency(String groupId, String artifactId, String version, String scope,String type) {
Artifact artifact = createArtifact(groupId, artifactId, version, scope,type);
private DefaultDependencyNode createDependency(String groupId, String artifactId, String version, String scope, String type) {
Artifact artifact = createArtifact(groupId, artifactId, version, scope, type);
return new DefaultDependencyNode(artifact);
}

Expand Down

0 comments on commit ad9f0f7

Please sign in to comment.