-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathCommonResponseTest.java
41 lines (33 loc) · 1.11 KB
/
CommonResponseTest.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
package com.aliyuncs;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.http.HttpResponse;
import com.aliyuncs.transform.UnmarshallerContext;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class CommonResponseTest {
private CommonResponse response;
@Before
public void creatResponse() {
response = new CommonResponse();
}
@Test
public void getSetTest() {
response.setData("test");
Assert.assertEquals("test", response.getData());
response.setHttpStatus(200);
Assert.assertEquals(200, response.getHttpStatus());
HttpResponse httpResponse = new HttpResponse();
response.setHttpResponse(httpResponse);
Assert.assertTrue(httpResponse == response.getHttpResponse());
}
@Test
public void getInstanceTest() throws ClientException {
UnmarshallerContext context = new UnmarshallerContext();
Assert.assertNull(response.getInstance(context));
}
@Test
public void checkShowJsonItemNameTest() {
Assert.assertTrue(response.checkShowJsonItemName());
}
}