EntmicroFollowerStaffServiceTest.java 3.02 KB
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));
    }
}