### Question:
WxaApi extends BaseApi { @Override protected String getRequestUri(String key) { String url = this.cache.getProperty(key); if (url != null) { return url; } if (this.properties != null && (url = this.properties.getProperty(key)) != null) { Matcher m = uriPattern.matcher(url); StringBuffer sb = new StringBuffer(); String sub = null; while (m.find()) { sub = m.group(); m.appendReplacement(sb, getRequestUri(sub.substring(1, sub.length() - 1))); } m.appendTail(sb); url = sb.toString(); } else { url = super.getRequestUri(key); } this.cache.setProperty(key, url); return url; } WxaApi();  WxaApi(Properties properties);   }### Answer:
@Test public void testGetRequestUriStringObjectArrayDefault() { WxaApi wxaApi = new WxaApi() { }; String uri = wxaApi.getRequestUri("sns_jscode2session", "myAppId", "mySecret", "myJsCode", "myGrantType"); assertEquals("https: }
@Test public void testGetRequestUriStringObjectArrayOverride() { Properties properties = new Properties(); properties.setProperty("api_base_url", "https: WxaApi wxaApi = new WxaApi(properties) { }; assertEquals( "https: wxaApi.getRequestUri("sns_jscode2session", "myAppId", "mySecret", "myJsCode", "myGrantType") ); }
@Test public void testFacadeWithProperties() { Properties properties = new Properties(); properties.setProperty("api_base_url", "https: properties.setProperty("api_cgi_url", "{api_base_url}/cgi-bin2"); WeixinAppFacade wxaFacade = new WeixinAppFacade(new WeixinAccount("myAppId", "mySecret"), new FileCacheStorager<Token>(), properties); assertEquals("https: assertEquals( "https: wxaFacade.getLoginApi().getRequestUri("sns_jscode2session", "myAppId", "mySecret", "myJsCode", "myGrantType") ); assertEquals( "https: wxaFacade.getTemplateApi().getRequestUri("wxopen_template_library_list", "myAccessToken") ); }