【add】添加 id查用户/id查组织 的测试代码
This commit is contained in:
+56
@@ -33,6 +33,8 @@ public class TestClient {
|
|||||||
testClient.sendOrgCreate(); // 组织创建接口测试
|
testClient.sendOrgCreate(); // 组织创建接口测试
|
||||||
testClient.sendQueryAllUserIdsService(); // 查询所有用户ID接口测试
|
testClient.sendQueryAllUserIdsService(); // 查询所有用户ID接口测试
|
||||||
testClient.sendQueryAllOrgIdsService(); // 查询所有组织ID接口测试
|
testClient.sendQueryAllOrgIdsService(); // 查询所有组织ID接口测试
|
||||||
|
testClient.sendQueryOrgByIdService(); // 查询指定id的组织数据测试
|
||||||
|
testClient.sendQueryUserByIdService(); // 查询指定id的用户数据测试
|
||||||
}
|
}
|
||||||
|
|
||||||
// 对数据解密
|
// 对数据解密
|
||||||
@@ -253,4 +255,58 @@ public class TestClient {
|
|||||||
this.decryptData(response);
|
this.decryptData(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户查询接口测试
|
||||||
|
*/
|
||||||
|
private void sendQueryUserByIdService() throws JsonProcessingException {
|
||||||
|
// 封装 IamUserAcceptDto 为用户数据层
|
||||||
|
IamUserAcceptDto iamUserAcceptDto = new IamUserAcceptDto();
|
||||||
|
iamUserAcceptDto.setBimUid("1709786346053017601"); // 数据库中取到的ID
|
||||||
|
iamUserAcceptDto.setBimRemoteUser("srmsIam");
|
||||||
|
iamUserAcceptDto.setBimRemotePwd("srmsIam2023");
|
||||||
|
|
||||||
|
// 加密数据
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
String sendData = objectMapper.writeValueAsString(iamUserAcceptDto);
|
||||||
|
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
||||||
|
|
||||||
|
// 封装 AcceptPoSystemPo 为PO层套壳
|
||||||
|
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
||||||
|
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
||||||
|
|
||||||
|
// 发送数据
|
||||||
|
String url = "http://localhost:8184/laws-sinotruk/sync/iam/QueryUserByIdService";
|
||||||
|
String response = HttpUtil.post(url, sendPoDataJson);
|
||||||
|
System.out.println("用户查询接口响应:" + response);
|
||||||
|
|
||||||
|
this.decryptData(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织查询接口测试
|
||||||
|
*/
|
||||||
|
private void sendQueryOrgByIdService() throws JsonProcessingException {
|
||||||
|
// 封装 IamUserAcceptDto 为用户数据层
|
||||||
|
IamOrgAcceptDto iamOrgAcceptDto = new IamOrgAcceptDto();
|
||||||
|
iamOrgAcceptDto.setBimOrgId("IA00102"); // 数据库中取到的ID
|
||||||
|
iamOrgAcceptDto.setBimRemoteUser("srmsIam");
|
||||||
|
iamOrgAcceptDto.setBimRemotePwd("srmsIam2023");
|
||||||
|
|
||||||
|
// 加密数据
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
String sendData = objectMapper.writeValueAsString(iamOrgAcceptDto);
|
||||||
|
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
||||||
|
|
||||||
|
// 封装 AcceptPoSystemPo 为PO层套壳
|
||||||
|
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
||||||
|
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
||||||
|
|
||||||
|
// 发送数据
|
||||||
|
String url = "http://localhost:8184/laws-sinotruk/sync/iam/QueryOrgByIdService";
|
||||||
|
String response = HttpUtil.post(url, sendPoDataJson);
|
||||||
|
System.out.println("组织查询接口响应:" + response);
|
||||||
|
|
||||||
|
this.decryptData(response);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user