BatchServiceTest.java
1.22 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
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 JpaTransactionManager;
import java.sql.SQLException;
@Slf4j
@SpringBootTest
public class BatchServiceTest {
@Autowired
BatchService batchService;
String groupId = "gsuzhou";
String day = "2023-07-05";
@Test
public void test1() {
log.info("init");
try {
batchService.buildBatchNo(groupId, "2023-07-04");
batchService.buildBatchNo(groupId, "2023-07-05");
batchService.buildBatchNo(groupId, "2023-07-06");
batchService.buildBatchNo(groupId, "2023-07-07");
} 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);
}
}
}