@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") ); }
@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 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 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); }
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);  }
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);   }