RopAppAccessRemoteTest.java
4.23 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package cn.com.glsx.dj.system;
import java.util.List;
import java.util.function.Consumer;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import cn.com.glsx.dj.system.dto.RopAppAccessDTO;
import cn.com.glsx.dj.system.dto.RopAppServiceDTO;
import cn.com.glsx.dj.system.enums.RopAppStatusEnum;
import cn.com.glsx.dj.system.model.RopAppAccess;
import cn.com.glsx.dj.system.remote.RopAppAccessRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
/**
* @Title: RopAppAccessRemoteTest.java
* @Description:
* @author Alvin
* @date 2019年12月24日 下午8:48:23
* @version V1.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2018
*/
public class RopAppAccessRemoteTest extends BaseRemoteTest {
@Autowired
private RopAppAccessRemote ropAppAccessRemote;
@Test
public void insert(){
RopAppAccess ropAppAccess = new RopAppAccess();
ropAppAccess.setAppId("rpc-ddh-smartcar");
ropAppAccess.setAppName("嘀嘀虎车智能");
ropAppAccess.setAppPrincipal("广联赛讯");
ropAppAccess.setAppStatus(RopAppStatusEnum.ON.getValue());
ropAppAccess.setCreatedBy("system");
ropAppAccess.setUpdatedBy("system");
RpcResponse<RopAppAccess> response = ropAppAccessRemote.insert(ropAppAccess);
Assert.assertTrue(response.hasResult());
System.out.println(response.getResult());
}
@Test
public void merge(){
RopAppAccess ropAppAccess = new RopAppAccess();
ropAppAccess.setId(1L);
ropAppAccess.setAppStatus(RopAppStatusEnum.OFF.getValue());
RpcResponse<Boolean> response = ropAppAccessRemote.merge(ropAppAccess);
Assert.assertTrue(response.hasResult());
System.out.println(response.getResult());
}
@Test
public void getByAppId(){
String appId = "rpc-ddh-smartcar";
RpcResponse<RopAppAccess> response = ropAppAccessRemote.getByAppId(appId);
Assert.assertTrue(response.hasResult());
System.out.println(response.getResult());
}
@Test
public void getAll(){
RpcResponse<List<RopAppAccess>> response = ropAppAccessRemote.getAll();
Assert.assertTrue(response.hasResult());
List<RopAppAccess> list = response.getResult();
list.forEach(new Consumer<RopAppAccess>() {
@Override
public void accept(RopAppAccess t) {
System.out.println(t);
}
});
}
@Test
public void getAppAccessServiceByAppId(){
String appId = "rpc-ddh-smartcar";
RpcResponse<RopAppAccessDTO> response = ropAppAccessRemote.getAppAccessServiceByAppId(appId);
Assert.assertTrue(response.hasResult());
RopAppAccessDTO ropAppAccessDTO = response.getResult();
System.out.println(ropAppAccessDTO);
List<RopAppServiceDTO> ropAppServiceList = ropAppAccessDTO.getRopAppServiceList();
if(ropAppServiceList != null && !ropAppServiceList.isEmpty()){
ropAppServiceList.forEach(new Consumer<RopAppServiceDTO>() {
@Override
public void accept(RopAppServiceDTO t) {
System.out.println(t);
}
});
}
}
@Test
public void getAllAppAccessService(){
RpcResponse<List<RopAppAccessDTO>> response = ropAppAccessRemote.getAllAppAccessService();
Assert.assertTrue(response.hasResult());
List<RopAppAccessDTO> list = response.getResult();
list.forEach(new Consumer<RopAppAccessDTO>() {
@Override
public void accept(RopAppAccessDTO ropAppAccessDTO) {
System.out.println(ropAppAccessDTO);
List<RopAppServiceDTO> ropAppServiceList = ropAppAccessDTO.getRopAppServiceList();
if(ropAppServiceList != null && !ropAppServiceList.isEmpty()){
ropAppServiceList.forEach(new Consumer<RopAppServiceDTO>() {
@Override
public void accept(RopAppServiceDTO t) {
System.out.println(t);
}
});
}
}
});
}
@Test
public void search(){
RpcPagination<RopAppAccess> pagination = new RpcPagination<>();
RopAppAccess condition = new RopAppAccess();
condition.setAppId("rpc-ddh-smartcar");
pagination.setCondition(condition);
RpcResponse<RpcPagination<RopAppAccess>> response = ropAppAccessRemote.search(pagination);
Assert.assertTrue(response.hasResult());
pagination = response.getResult();
List<RopAppAccess> list = pagination.getList();
list.forEach(new Consumer<RopAppAccess>() {
@Override
public void accept(RopAppAccess t) {
System.out.println(t);
}
});
}
}