}
public void testPrefixNoMatch()
{
IComponent component = (IComponent) newMock(IComponent.class);
IBinding binding = (IBinding) newMock(IBinding.class);
MockControl factoryControl = newControl(BindingFactory.class);
BindingFactory literalFactory = (BindingFactory) factoryControl.getMock();
BindingFactory factory = (BindingFactory) newMock(BindingFactory.class);
Location l = fabricateLocation(99);
// Training
literalFactory.createBinding(component, "zip", "unknown:path part of locator", l);
factoryControl.setReturnValue(binding);
BindingPrefixContribution c = new BindingPrefixContribution();
c.setPrefix("prefix");
c.setFactory(factory);
replayControls();
BindingSourceImpl bs = new BindingSourceImpl();
bs.setContributions(Collections.singletonList(c));
bs.setLiteralBindingFactory(literalFactory);
bs.initializeService();
IBinding actual = bs.createBinding(
component,
"zip",
"unknown:path part of locator",
BindingConstants.LITERAL_PREFIX,
l);