-
Notifications
You must be signed in to change notification settings - Fork 5
/
AccountTest.java
104 lines (95 loc) · 3.38 KB
/
AccountTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package ai.bianjie.avatasdktest;
import ai.bianjie.avatasdk.AvataClient;
import ai.bianjie.avatasdk.model.account.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class AccountTest {
private AvataClient client;
@BeforeEach
public void init() {
client = AvataClientTest.getAvataClient();
}
@Test
//请求创建链账户接口示例
void TestCreateAccount() {
CreateAccountReq req = new CreateAccountReq();
req.setName("lmhtest");
req.setOperationId("createaccount");
try {
CreateAccountRes account = client.account.createAccount(req);
System.out.println(account.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求查询链账户接口示例
void TestQueryAccount() {
QueryAccountsReq req = new QueryAccountsReq();
//req.setPageKey("");
//req.setLimit("3");
//req.setAccount("");
// req.setName("");
//req.setOperationId("");
//req.setStartDate("");
//req.setEndDate("");
//req.setSortBy("");
req.setCountTotal("1");
try {
QueryAccountsRes account = client.account.queryAccounts(req);
System.out.println(account.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求批量创建链账户接口示例
void TestBatchCreateAccount() {
BatchCreateAccountReq req = new BatchCreateAccountReq();
req.setCount(1);
req.setOperationId("batchcreateaccount");
try {
BatchCreateAccountRes account = client.account.batchCreateAccounts(req);
System.out.println(account.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//原生模块:请求查询链账户操作记录接口示例
void TestQueryNativeAccountHistory() {
QueryAccountsHistoryReq req = new QueryAccountsHistoryReq();
//req.setPageKey("");
//req.setLimit("");
req.setAccount("iaa1jjmwg5ah27aynuwt2phwa8sfvzh4lvvlelddxm");
try {
QueryNatAccountsHistoryRes account = client.account.queryNativeAccountsHistory(req);
System.out.println(account.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//EVM 模块:请求查询链账户操作记录接口示例
void TestQueryEvmAccountHistory() {
QueryAccountsHistoryReq req = new QueryAccountsHistoryReq();
//req.setPageKey("");
//req.setLimit("");
try {
QueryEvmAccountsHistoryRes account = client.account.queryEvmAccountsHistory(req);
System.out.println(account.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
}