package org.thinkinghub.gateway.core;


import org.junit.Test;
import org.thinkinghub.gateway.api.WeixinApi;

import static org.junit.Assert.assertEquals;

public class WeixinApiTest {
    private static final String AUTHORIZE_URL = "https://open.weixin.qq.com/connect/qrconnect?appid=%s&redirect_uri=%s&response_type=code&state=esfadsgsad34fwdef&scope=snsapi_login#wechat_redirect";

    @Test
    public void getAuthorizationBaseUrl() {
        assertEquals(WeixinApi.instance().getAuthorizationBaseUrl(), AUTHORIZE_URL);
    }
}

@@ -33,16 +33,69 @@
 core;%0A%0A%0A
+import com.github.scribejava.core.model.OAuthConfig;%0A
 import o
@@ -243,23 +243,16 @@
 private 
-static 
 final St
@@ -321,111 +321,98 @@
 nect
-?appid=%25s&redirect_uri=%25s&response_type=code&state=esfadsgsad34fwdef&scope=snsapi_login#wechat_redirect
+%22;%0A    private final String TOKEN_URL = %22https://api.weixin.qq.com/sns/oauth2/access_token
 %22;%0A%0A
@@ -486,16 +486,32 @@
 tEquals(
+ AUTHORIZE_URL, 
 WeixinAp
@@ -552,23 +552,474 @@
 rl()
-, AUTHORIZE_URL
+);%0A    %7D%0A%0A    @Test%0A    public void getAccessTokenEndpoint()%7B%0A        assertEquals(TOKEN_URL,  WeixinApi.instance().getAccessTokenEndpoint());%0A    %7D%0A%0A    @Test%0A    public void getAuthorizationUrl()%7B%0A        OAuthConfig config = new OAuthConfig(%22myTestAppid%22, %22myTestSecret%22,null, null, null, null, null, %22code%22,null, null,null,null);%0A        assertEquals(AUTHORIZE_URL + %22?response_type=code&appid=myTestAppid%22, WeixinApi.instance().getAuthorizationUrl(config, null)
 );%0A 
@@ -1023,10 +1023,11 @@
 ;%0A    %7D%0A
+%0A
 %7D%0A

Refactor the test case for WeixinAPI