package com.ruoyi;

import com.xkcoding.http.config.HttpConfig;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.request.AuthGoogleRequest;
import me.zhyd.oauth.request.AuthRequest;
import org.junit.Test;

import java.net.InetSocketAddress;
import java.net.Proxy;

public class GoogleAuthTest {


    @Test
    public void authTestUrl() {
        AuthRequest authRequest = new AuthGoogleRequest(AuthConfig.builder()
                .clientId("53136391241-3dfivrv7tgsig1l73bisgr8p8t3i453p.apps.googleusercontent.com")
                .clientSecret("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")
                .redirectUri("http://localhost:8080")
                // 针对国外平台配置代理
                .httpConfig(HttpConfig.builder()
                        .timeout(15000)
                        // host 和 port 请修改为开发环境的参数
                        .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)))
                        .build())
                .build());
        System.out.println(authRequest);
    }
}
