use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.FinalStepTransformJsonProtoHaskellCabalLibrariesToHackage in project synopsys-detect by blackducksoftware.
the class FinalStepTransformJsonProtoHaskellCabalLibrariesToHackageTest method testStep.
@Test
public void testStep() throws IntegrationException, IOException {
File jsonProtoFile = new File("src/test/resources/detectables/functional/bazel/jsonProtoForHaskellCabalLibraries.txt");
String jsonProtoHaskellCabalLibrary = FileUtils.readFileToString(jsonProtoFile, StandardCharsets.UTF_8);
FinalStepTransformJsonProtoHaskellCabalLibrariesToHackage step = new FinalStepTransformJsonProtoHaskellCabalLibrariesToHackage(new HaskellCabalLibraryJsonProtoParser(new Gson()), new ExternalIdFactory());
List<String> input = new ArrayList<>(1);
input.add(jsonProtoHaskellCabalLibrary);
List<Dependency> dependencies = step.finish(input);
DependencyGraph dependencyGraph = new BasicDependencyGraph();
for (Dependency dependency : dependencies) {
dependencyGraph.addChildToRoot(dependency);
}
Forge hackageForge = new Forge("/", "hackage");
GraphAssert graphAssert = new GraphAssert(hackageForge, dependencyGraph);
graphAssert.hasRootSize(1);
ExternalId expectedExternalId = new ExternalIdFactory().createNameVersionExternalId(hackageForge, "colour", "2.3.5");
graphAssert.hasRootDependency(expectedExternalId);
}
Aggregations