use of com.synopsys.integration.bdio.model.BdioId in project synopsys-detect by blackducksoftware.
the class GraphCompare method assertSummaries.
private static void assertSummaries(GraphSummary expected, GraphSummary actual) {
assertSet(expected.rootExternalDataIds, actual.rootExternalDataIds, "Root external ids");
assertSet(expected.dependencySummaries.keySet(), actual.dependencySummaries.keySet(), "Dependencies in graph");
Set<BdioId> expectedRelationshipIds = expected.externalDataIdRelationships.keySet();
Set<BdioId> expectedExistingRelationshipsIds = expectedRelationshipIds.stream().filter(key -> expected.externalDataIdRelationships.get(key) != null && expected.externalDataIdRelationships.get(key).size() > 0).collect(Collectors.toSet());
Set<BdioId> actualRelationshipIds = actual.externalDataIdRelationships.keySet();
Set<BdioId> actualExistingRelationshipsIds = actualRelationshipIds.stream().filter(key -> actual.externalDataIdRelationships.get(key) != null && actual.externalDataIdRelationships.get(key).size() > 0).collect(Collectors.toSet());
assertSet(expectedExistingRelationshipsIds, actualExistingRelationshipsIds, "Existing relationships");
for (BdioId key : expected.dependencySummaries.keySet()) {
Assertions.assertEquals(expected.dependencySummaries.get(key).getName(), actual.dependencySummaries.get(key).getName());
Assertions.assertEquals(expected.dependencySummaries.get(key).getVersion(), actual.dependencySummaries.get(key).getVersion());
}
for (BdioId key : expectedExistingRelationshipsIds) {
assertSet(expected.externalDataIdRelationships.get(key), actual.externalDataIdRelationships.get(key), "External data id relationships for " + key);
}
}
Aggregations