use of org.eclipse.jkube.kit.common.Dependency in project jkube by eclipse.
the class MavenUtilTest method testGetTransitiveDependencies.
@Test
public void testGetTransitiveDependencies(@Mocked MavenProject mavenProject) {
// Given
final Artifact artifact1 = new DefaultArtifact("org.eclipse.jkube", "foo-dependency", "1.33.7", "runtime", "jar", "", new DefaultArtifactHandler("jar"));
final Artifact artifact2 = new DefaultArtifact("org.eclipse.jkube", "bar-dependency", "1.33.7", "runtime", "jar", "", new DefaultArtifactHandler("jar"));
new Expectations() {
{
mavenProject.getArtifacts();
result = new HashSet<>(Arrays.asList(artifact1, artifact2));
}
};
// When
final List<Dependency> result = MavenUtil.getTransitiveDependencies(mavenProject);
// Then
assertThat(result).hasSize(2).contains(Dependency.builder().groupId("org.eclipse.jkube").artifactId("foo-dependency").version("1.33.7").type("jar").scope("runtime").build(), Dependency.builder().groupId("org.eclipse.jkube").artifactId("bar-dependency").version("1.33.7").type("jar").scope("runtime").build());
}
Aggregations