OSDN Git Service

Merge pull request #4 from Bytom/retireTx
[bytom/bytom-java-sdk.git] / src / test / java / io / bytom / integration / AccessTokenTest.java
1 package io.bytom.integration;
2
3 import io.bytom.TestUtils;
4 import io.bytom.api.AccessToken;
5 import io.bytom.exception.BytomException;
6 import io.bytom.http.Client;
7 import org.junit.Test;
8
9 import java.util.List;
10
11 public class AccessTokenTest {
12
13     static Client client;
14
15     static {
16         try {
17             client = TestUtils.generateClient();
18         } catch (BytomException e) {
19             e.printStackTrace();
20         }
21     }
22
23     @Test
24     public void testTokenCreate() throws Exception {
25         AccessToken accessToken = new AccessToken.Builder().setId("sheng").create(client);
26     }
27
28
29     @Test
30     public void testTokenList() throws Exception {
31         List<AccessToken> tokenList = AccessToken.list(client);
32     }
33
34     @Test
35     public void testTokenCheck() throws Exception {
36         String secret = "5e37378eb59de6b10e60f2247ebf71c4955002e75e0cd31ede3bf48813a0a799";
37         AccessToken.check(client, "sheng", secret);
38     }
39 }