EntmicroFollowerStaffServiceTest.java
3.02 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
package cn.com.glsx.entmicro.service;
import cn.com.glsx.entmicro.Main;
import cn.com.glsx.entmicro.model.request.EntmicroFollowerStaffRequest;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import static org.junit.Assert.*;
/**
* @author Lichongyuan
* @Description:
* @date 2021/9/22 15:19
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class EntmicroFollowerStaffServiceTest {
public static void main(String[] args) {
String a = "http://";
StringBuilder sb =new StringBuilder(a);
sb.insert(4,"s");
System.out.println(a);
System.out.println(sb);
System.out.println(sb.toString());
}
@Autowired
private EntmicroFollowerStaffService entmicroFollowerStaffService;
@Test
public void saveFollowerStaff() {
EntmicroFollowerStaffRequest entmicroFollowerStaffRequest = new EntmicroFollowerStaffRequest();
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);
entmicroFollowerStaffRequest.setIds(list);
entmicroFollowerStaffRequest.setFollowerTypeId(2);
entmicroFollowerStaffRequest.setUserIds(Arrays.asList("shoudong"));
entmicroFollowerStaffRequest.setMerchantId(44210823);
String str = StringUtils.join(Arrays.asList(1, 4), ",");
entmicroFollowerStaffRequest.setBusinessTypeId(str);
entmicroFollowerStaffService.saveFollowerStaff(entmicroFollowerStaffRequest);
}
@Test
public void deleteFollowerStaff() {
EntmicroFollowerStaffRequest entmicroFollowerStaffRequest = new EntmicroFollowerStaffRequest();
entmicroFollowerStaffRequest.setId(2);
entmicroFollowerStaffService.deleteFollowerStaff(entmicroFollowerStaffRequest);
}
@Test
public void listFollowerStaffByPage() {
EntmicroFollowerStaffRequest entmicroFollowerStaffRequest = new EntmicroFollowerStaffRequest();
entmicroFollowerStaffRequest.setMerchantId(44210895);
RpcPagination<EntmicroFollowerStaffRequest> pagination = new RpcPagination<>();
pagination.setPageSize(10);
pagination.setPageNum(1);
pagination.setCondition(entmicroFollowerStaffRequest);
System.out.println(entmicroFollowerStaffService.listFollowerStaffByPage(pagination));
}
@Test
public void findEntFollowStaffSpecTest(){
EntmicroFollowerStaffRequest request = new EntmicroFollowerStaffRequest();
request.setMerchantIds(Arrays.asList(44211025,44209846));
System.out.println(entmicroFollowerStaffService.findEntFollowStaffSpec(request));
}
}