package org.ta.pddserver;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.ta.pddserver.model.enums.IdentityErrorType;
import org.ta.pddserver.utils.WorldexUtil;

import java.util.HashMap;
import java.util.Map;

@Slf4j
public class WordexAPITest {
    private static final String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiIsImtpZCI6ImtleUlkIn0.eyJpc3MiOiJhcGkud29ybGRleC5rciIsImF1ZCI6InVzZXIiLCJzdWIiOiJ0b2tlbiIsImp0aSI6ImhqcGRkankiLCJpYXQiOjE3NjE4MTI0ODEsIm5iZiI6MTc2MTgxMjQyMSwiZXhwIjoxNzYxODg0NDgxfQ.xeukpmS86euu44XzyQ8USM2tMCdXIqCXhjoe1QrpgcB2O5dHkY3_ixAWNmL2c7SnDOWL0kHanLX-h668zDQiHQ";

    @Test
    public void testLogin() {
        JSONObject jsonObject = WorldexUtil.login();
        if (jsonObject != null) {
            String token = jsonObject.getString("token");
            log.info("token:{}", token);
            return;
        }
        log.error("login failed");

        //
    }

    @Test
    public void verify() {
        org.ta.pddserver.model.enums.IdentityErrorType type = WorldexUtil.verifyIdentity("nanjiexi", "P11111111", "01099999999");
        log.info("type:{}", type);
    }
}
