-
Notifications
You must be signed in to change notification settings - Fork 1
/
OrderApiClientTest.java
55 lines (49 loc) · 1.48 KB
/
OrderApiClientTest.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
package com.neoremind.example.simple.api.client;
import com.google.common.collect.Lists;
import com.hulu.ap.example.production.server.client.ApiException;
import com.hulu.ap.example.production.server.client.Order;
import com.hulu.ap.example.production.server.client.OrderApi;
import com.hulu.ap.example.production.server.client.OrderDtoList;
import org.junit.Ignore;
import org.junit.Test;
/**
* @author xu.zhang
*/
@Ignore
public class OrderApiClientTest {
@Test
public void test_query_all_orders() {
OrderApi api = new OrderApi();
OrderDtoList list = null;
try {
list = api.queryAllOrders();
} catch (ApiException e) {
e.printStackTrace();
}
System.out.println(list.getOrderList());
}
@Test
public void test_query_by_orderid() {
OrderApi api = new OrderApi();
try {
Order orderDto = api.queryByOrderId(100);
System.out.println(orderDto);
} catch (ApiException e) {
e.printStackTrace();
}
}
@Test
public void test_create_order() {
OrderApi api = new OrderApi();
try {
Order o = new Order();
o.setProductIds(Lists.newArrayList(1L, 2L));
o.setCreatedBy("John");
o.setOrderPlacedDate("20170101");
Order orderDto = api.create(o);
System.out.println(orderDto);
} catch (ApiException e) {
e.printStackTrace();
}
}
}