@Test
public void config_withMappings() {
ApplicationContext factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir,
"services-uris.xml")));
URIBrokerService uris = (URIBrokerService) factory.getBean("uris");
URIBroker link1 = uris.getURIBroker("link1");
assertEquals("http://taobao.com/hello", link1.toString());
TurbineURIBroker link2 = (TurbineURIBroker) uris.getURIBroker("link2");
assertSame(factory.getBean("mappingRuleService"), link2.getMappingRuleService());
assertEquals("http://taobao.com/mycontext/myservlet/mycomponent/my_target.htm?action=myAction",
link2.toString());
TurbineURIBroker link3 = (TurbineURIBroker) uris.getURIBroker("link3");
assertSame(factory.getBean("mapping2"), link3.getMappingRuleService());
assertEquals("http://taobao.com/mycontext/myservlet/mycomponent/myTarget.vhtml?myaction=myAction",
link3.toString());
}