package com.malk.xiding; import com.kingdee.bos.webapi.entity.IdentifyInfo; import com.malk.xiding.config.KDWebApiConf; import lombok.extern.slf4j.Slf4j; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @Slf4j @SpringBootTest @RunWith(SpringRunner.class) public class JdTest { @Autowired private KDWebApiConf kdWebApiConf; private IdentifyInfo initIden(){ //注意 1:此处不再使用参数形式传入用户名及密码等敏感信息,改为在登录配置文件中设置。 //注意 2:必须先配置第三方系统登录授权信息后,再进行业务操作,详情参考各语言版本SDK介绍中的登录配置文件说明。 //读取配置,初始化SDK IdentifyInfo iden = new IdentifyInfo(); iden.setUserName(kdWebApiConf.getXKDApiUserName()); iden.setAppId(kdWebApiConf.getXKDApiAppID()); iden.setdCID(kdWebApiConf.getXKDApiAcctID()); iden.setAppSecret(kdWebApiConf.getXKDApiAppSec()); iden.setServerUrl(kdWebApiConf.getXKDApiServerUrl()); return iden; } }