control.verify();
}
public void testRequiredPath_OptionalInPath() throws Exception {
DependencyGraph graph = new DependencyGraph.Builder(origin)
.addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
.addEdge(new Dependency(foo(), bar(), SOURCE))
.addEdge(new Dependency(bar(), baz(), SOURCE))
.addEdge(new Dependency(foo(), baz(), true, false, SOURCE)) // avoid optional short-cut
.build();
control.replay();
assertEquals(
TestUtils.dependencyList(
new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
new Dependency(foo(), bar(), SOURCE),
new Dependency(bar(), baz(), SOURCE)),
new PathFinder().onGraph(graph)
.addRoots(Dependency.GINJECTOR)
.addDestinations(baz())
.withOnlyRequiredEdges(true).findShortestPath());
control.verify();