use of com.synopsys.integration.detectable.detectables.xcode.model.PackageResolved in project synopsys-detect by blackducksoftware.
the class PackageResolvedTransformerTest method testHttpsWithGit.
@Test
void testHttpsWithGit() {
ResolvedPackage swiftCollectionsPackage = new ResolvedPackage("swift-collections", "https://github.com/apple/swift-collections.git", new PackageState(null, "2d33a0ea89c961dcb2b3da2157963d9c0370347e", "1.0.1"));
PackageResolved packageResolved = createPackageResolved(swiftCollectionsPackage);
PackageResolvedTransformer transformer = new PackageResolvedTransformer(externalIdFactory);
DependencyGraph dependencyGraph = transformer.transform(packageResolved);
GraphAssert graphAssert = new GraphAssert(Forge.GITHUB, dependencyGraph);
ExternalId swiftCollections = externalIdFactory.createNameVersionExternalId(Forge.GITHUB, "apple/swift-collections", "1.0.1");
graphAssert.hasRootDependency(swiftCollections);
graphAssert.hasRootSize(1);
}
use of com.synopsys.integration.detectable.detectables.xcode.model.PackageResolved in project synopsys-detect by blackducksoftware.
the class PackageResolvedTransformerTest method createPackageResolved.
private PackageResolved createPackageResolved(ResolvedPackage resolvedPackage) {
List<ResolvedPackage> resolvedPackages = Collections.singletonList(resolvedPackage);
ResolvedObject resolvedObject = new ResolvedObject(resolvedPackages);
return new PackageResolved(resolvedObject, "1");
}
use of com.synopsys.integration.detectable.detectables.xcode.model.PackageResolved in project synopsys-detect by blackducksoftware.
the class PackageResolvedFormatCheckerTest method compatibilityTest.
@ParameterizedTest
@MethodSource("knownFileFormats")
void compatibilityTest(String knownVersion) {
PackageResolvedFormatChecker formatChecker = new PackageResolvedFormatChecker();
PackageResolved packageResolved = new PackageResolved(null, knownVersion);
formatChecker.handleVersionCompatibility(packageResolved, (version, knownVersions) -> Assertions.fail(version + " is a known version and should not have failed the check."));
}
use of com.synopsys.integration.detectable.detectables.xcode.model.PackageResolved in project synopsys-detect by blackducksoftware.
the class PackageResolvedFormatCheckerTest method incompatibilityTest.
@Test
void incompatibilityTest() {
PackageResolvedFormatChecker formatChecker = new PackageResolvedFormatChecker();
String unknownVersion = "some unknown version";
PackageResolved packageResolved = new PackageResolved(null, unknownVersion);
formatChecker.handleVersionCompatibility(packageResolved, (version, knownVersions) -> Assertions.assertEquals(unknownVersion, version));
}
Aggregations