Search in sources :

Example 6 with CargoLockPackage

use of com.synopsys.integration.detectable.detectables.cargo.model.CargoLockPackage in project synopsys-detect by blackducksoftware.

the class CargoLockPackageDataTransformerTest method transformNoVersion.

@Test
void transformNoVersion() {
    CargoDependencyLineParser cargoDependencyLineParser = new CargoDependencyLineParser();
    CargoLockPackageDataTransformer transformer = new CargoLockPackageDataTransformer(cargoDependencyLineParser);
    CargoLockPackageData cargoLockPackageData = new CargoLockPackageData("some-name", null, null, null, Collections.emptyList());
    CargoLockPackage cargoLockPackage = transformer.transform(cargoLockPackageData);
    assertEquals(new NameVersion("some-name", null), cargoLockPackage.getPackageNameVersion());
    assertTrue(cargoLockPackage.getDependencies().isEmpty());
}
Also used : NameVersion(com.synopsys.integration.util.NameVersion) CargoLockPackageData(com.synopsys.integration.detectable.detectables.cargo.data.CargoLockPackageData) CargoDependencyLineParser(com.synopsys.integration.detectable.detectables.cargo.parse.CargoDependencyLineParser) CargoLockPackage(com.synopsys.integration.detectable.detectables.cargo.model.CargoLockPackage) Test(org.junit.jupiter.api.Test)

Aggregations

CargoLockPackage (com.synopsys.integration.detectable.detectables.cargo.model.CargoLockPackage)6 NameVersion (com.synopsys.integration.util.NameVersion)4 Test (org.junit.jupiter.api.Test)4 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)3 NameOptionalVersion (com.synopsys.integration.detectable.util.NameOptionalVersion)3 ArrayList (java.util.ArrayList)3 CargoLockPackageData (com.synopsys.integration.detectable.detectables.cargo.data.CargoLockPackageData)2 CargoDependencyLineParser (com.synopsys.integration.detectable.detectables.cargo.parse.CargoDependencyLineParser)2 NameVersionGraphAssert (com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert)2 Toml (com.moandjiezana.toml.Toml)1 CodeLocation (com.synopsys.integration.detectable.detectable.codelocation.CodeLocation)1 CargoLockData (com.synopsys.integration.detectable.detectables.cargo.data.CargoLockData)1 Extraction (com.synopsys.integration.detectable.extraction.Extraction)1 Optional (java.util.Optional)1