use of com.synopsys.integration.detectable.detectables.maven.cli.MavenParseResult in project synopsys-detect by blackducksoftware.
the class MavenComplexOutputTest method test.
@Test
public void test() {
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
MavenCodeLocationPackager packager = new MavenCodeLocationPackager(externalIdFactory);
List<MavenParseResult> results = packager.extractCodeLocations("", getInput(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.MAVEN, results.get(0).getCodeLocation().getDependencyGraph());
graphAssert.hasRootSize(1);
ExternalId hubCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common", "13.1.2");
ExternalId integrationCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "integration-common", "6.0.2");
ExternalId hubCommonRest = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common-rest", "2.1.3");
graphAssert.hasRootDependency(hubCommon);
graphAssert.hasParentChildRelationship(hubCommonRest, integrationCommon);
graphAssert.hasParentChildRelationship(hubCommon, hubCommonRest);
}
use of com.synopsys.integration.detectable.detectables.maven.cli.MavenParseResult in project synopsys-detect by blackducksoftware.
the class MavenCorruptOutputTest method test.
@Test
public void test() {
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
MavenCodeLocationPackager packager = new MavenCodeLocationPackager(externalIdFactory);
List<MavenParseResult> results = packager.extractCodeLocations("", getInput(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.MAVEN, results.get(0).getCodeLocation().getDependencyGraph());
graphAssert.hasRootSize(1);
ExternalId hubCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common", "13.1.2");
ExternalId integrationCommon = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "integration-common", "6.0.2");
ExternalId hubCommonRest = externalIdFactory.createMavenExternalId("com.blackducksoftware.integration", "hub-common-rest", "2.1.3");
graphAssert.hasRootDependency(hubCommon);
graphAssert.hasParentChildRelationship(hubCommonRest, integrationCommon);
graphAssert.hasParentChildRelationship(hubCommon, hubCommonRest);
}
Aggregations