Search in sources :

Example 76 with NameVersionGraphAssert

use of com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert in project synopsys-detect by blackducksoftware.

the class XcodeSwiftDetectableTest method assertExtraction.

@Override
public void assertExtraction(@NotNull Extraction extraction) {
    Assertions.assertNotEquals(0, extraction.getCodeLocations().size(), "A code location should have been generated.");
    NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.GITHUB, extraction.getCodeLocations().get(0).getDependencyGraph());
    graphAssert.hasRootDependency("apple/swift-argument-parser", "1.0.1");
    graphAssert.hasRootDependency("auth0/Auth0.swift", "1.35.0");
    graphAssert.hasRootDependency("mac-cain13/R.swift.Library", "5.4.0");
    graphAssert.hasNoDependency("invalid/url", "1.2.3");
    graphAssert.hasRootSize(3);
}
Also used : NameVersionGraphAssert(com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert)

Aggregations

NameVersionGraphAssert (com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert)76 Test (org.junit.jupiter.api.Test)35 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)32 ExternalIdFactory (com.synopsys.integration.bdio.model.externalid.ExternalIdFactory)18 ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)10 CodeLocation (com.synopsys.integration.detectable.detectable.codelocation.CodeLocation)10 UnitTest (com.synopsys.integration.detectable.annotations.UnitTest)7 ArrayList (java.util.ArrayList)6 PnpmLockYaml (com.synopsys.integration.detectable.detectables.pnpm.lockfile.model.PnpmLockYaml)5 PnpmYamlTransformer (com.synopsys.integration.detectable.detectables.pnpm.lockfile.process.PnpmYamlTransformer)5 PipFreeze (com.synopsys.integration.detectable.detectables.pipenv.build.model.PipFreeze)4 PipenvGraph (com.synopsys.integration.detectable.detectables.pipenv.build.model.PipenvGraph)4 PipenvGraphEntry (com.synopsys.integration.detectable.detectables.pipenv.build.model.PipenvGraphEntry)4 PipenvTransformer (com.synopsys.integration.detectable.detectables.pipenv.build.parser.PipenvTransformer)4 PoetryLockParser (com.synopsys.integration.detectable.detectables.poetry.parser.PoetryLockParser)4 FunctionalTest (com.synopsys.integration.detectable.annotations.FunctionalTest)3 GemlockParser (com.synopsys.integration.detectable.detectables.rubygems.gemlock.parse.GemlockParser)3 BitbakeGraph (com.synopsys.integration.detectable.detectables.bitbake.model.BitbakeGraph)2 BitbakeDependencyGraphTransformer (com.synopsys.integration.detectable.detectables.bitbake.transform.BitbakeDependencyGraphTransformer)2 CargoLockPackage (com.synopsys.integration.detectable.detectables.cargo.model.CargoLockPackage)2