forked from ringcentral/ringcentral-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLowLevelAPITest.java
More file actions
29 lines (23 loc) · 985 Bytes
/
LowLevelAPITest.java
File metadata and controls
29 lines (23 loc) · 985 Bytes
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
package com.ringcentral;
import com.ringcentral.definitions.GetExtensionInfoResponse;
import okhttp3.ResponseBody;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertNotNull;
public class LowLevelAPITest {
@Test
public void testParseObject() throws IOException, RestException {
RestClient rc = new RestClient(
System.getenv("RINGCENTRAL_CLIENT_ID"),
System.getenv("RINGCENTRAL_CLIENT_SECRET"),
System.getenv("RINGCENTRAL_SERVER_URL")
);
rc.authorize(System.getenv("RINGCENTRAL_JWT_TOKEN"));
ResponseBody responseBody = rc.get("/restapi/v1.0/account/~/extension/~", null);
String responseString = responseBody.string();
GetExtensionInfoResponse extensionInfo = Utils.gson.fromJson(responseString, GetExtensionInfoResponse.class);
assertNotNull(extensionInfo);
assertNotNull(extensionInfo.extensionNumber);
rc.revoke();
}
}