use of com.synopsys.integration.detectable.util.graph.MavenGraphAssert in project synopsys-detect by blackducksoftware.
the class GradleReplacementDetectableTest method assertExtraction.
@Override
public void assertExtraction(@NotNull Extraction extraction) {
ExtractionUtil.assertSuccessWithCodeLocationCount(extraction, 3);
CodeLocation root = ExtractionUtil.assertAndGetCodeLocationNamed("root", extraction);
CodeLocation projectA = ExtractionUtil.assertAndGetCodeLocationNamed("projectA", extraction);
CodeLocation projectB = ExtractionUtil.assertAndGetCodeLocationNamed("projectB", extraction);
MavenGraphAssert rootGraph = new MavenGraphAssert(root.getDependencyGraph());
MavenGraphAssert projectAGraph = new MavenGraphAssert(projectA.getDependencyGraph());
MavenGraphAssert projectBGraph = new MavenGraphAssert(projectB.getDependencyGraph());
rootGraph.hasDependency("org.replacement:replaced:3.0.0");
projectAGraph.hasRootDependency("org.replacement:replaced:2.0.0");
projectBGraph.hasRootDependency("org.replacement:replaced:1.0.0");
}
use of com.synopsys.integration.detectable.util.graph.MavenGraphAssert in project synopsys-detect by blackducksoftware.
the class GradleReportParserFunctionalTest method complexTest.
@Test
void complexTest() {
Optional<CodeLocation> codeLocation = buildCodeLocation("/gradle/complex_dependencyGraph.txt", true);
Assertions.assertTrue(codeLocation.isPresent());
DependencyGraph graph = codeLocation.get().getDependencyGraph();
MavenGraphAssert graphAssert = new MavenGraphAssert(graph);
graphAssert.hasDependency("non-project:with-nested:1.0.0");
graphAssert.hasDependency("solo:component:4.12");
graphAssert.hasDependency("some.group:child:2.2.2");
graphAssert.hasDependency("terminal:child:6.2.3");
// TODO: Get this to work in a sensible way
// graphAssert.noDependency("child-project");
// graphAssert.noDependency("nested-parent");
// graphAssert.noDependency("spring-webflux");
// graphAssert.noDependency("spring-beans");
// graphAssert.noDependency("spring-core");
// graphAssert.noDependency("spring-web");
// graphAssert.noDependency("should-suppress");
graphAssert.hasRootDependency("solo:component:4.12");
graphAssert.hasRootDependency("non-project:with-nested:1.0.0");
graphAssert.hasRootDependency("some.group:parent:5.0.0");
graphAssert.hasRootDependency("terminal:child:6.2.3");
ExternalId parent = graphAssert.hasDependency("some.group:parent:5.0.0");
ExternalId child = graphAssert.hasDependency("some.group:child:2.2.2");
graphAssert.hasParentChildRelationship(parent, child);
}
Aggregations