control.verify();
}
public void testImplicitBinding() throws Exception {
expect(origin.getDependencies()).andStubReturn(TestUtils.dependencyList(
new Dependency(Dependency.GINJECTOR, foo(), SOURCE)));
expect(origin.getParent()).andStubReturn(null);
expect(origin.isBound(foo())).andReturn(false).anyTimes();
expect(origin.isPinned(foo())).andReturn(false).anyTimes();
expect(bindingCreator.create(foo())).andReturn(binding);
expect(binding.getDependencies()).andReturn(TestUtils.dependencyList(
new Dependency(foo(), bar(), SOURCE)));
expect(origin.isBound(bar())).andReturn(true).anyTimes();
control.replay();
DependencyExplorerOutput output = dependencyExplorer.explore(origin);
assertSame(origin, output.getPreExistingLocations().get(bar()));
assertEmpty(output.getBindingErrors());
assertEquals(1, output.getImplicitlyBoundKeys().size());
assertEquals(foo(), output.getImplicitBindings().iterator().next().getKey());
assertEquals(binding, output.getImplicitBindings().iterator().next().getValue());
DependencyGraph graph = output.getGraph();
assertContentsAnyOrder(graph.getDependenciesTargeting(foo()),
new Dependency(Dependency.GINJECTOR, foo(), SOURCE));
assertContentsAnyOrder(graph.getDependenciesTargeting(bar()),
new Dependency(foo(), bar(), SOURCE));
control.verify();
}