BatchServiceTest.java 1019 Bytes
package com.dituhui.pea.pre;


import cn.hutool.core.util.IdUtil;
import com.dituhui.pea.pre.service.BatchService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.sql.SQLException;

@Slf4j
@SpringBootTest
public class BatchServiceTest {
    @Autowired
    BatchService batchService;

    String groupId = "gsuzhou";
    String day = "2023-06-16";

    @Test
    public void test1() {
        log.info("init");
        try {
            batchService.buildBatchNo(groupId, day);
        } catch (SQLException e) {
            log.info("error %s", e);
            throw new RuntimeException(e);
        }
        log.info("done");
    }


    @Test
    public void test2() {
        log.info("init");
        for (int i = 0; i < 100; i++) {
            String orderNO= IdUtil.getSnowflake().nextIdStr();
            log.info("oid:{}", orderNO);
        }
    }
}