dongyukun
2024-12-31 0a2b23ad3f30dfb01c5d590fb98f39e93bfe1932
提交 | 用户 | 时间
e7c126 1 package com.xxl.job.admin.dao;
H 2
3 import com.xxl.job.admin.core.model.XxlJobRegistry;
4 import org.junit.jupiter.api.Test;
5 import org.springframework.boot.test.context.SpringBootTest;
6
7 import javax.annotation.Resource;
8 import java.util.Arrays;
9 import java.util.Date;
10 import java.util.List;
11
12 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
13 public class XxlJobRegistryDaoTest {
14
15     @Resource
16     private XxlJobRegistryDao xxlJobRegistryDao;
17
18     @Test
19     public void test(){
20         int ret = xxlJobRegistryDao.registryUpdate("g1", "k1", "v1", new Date());
21         if (ret < 1) {
22             ret = xxlJobRegistryDao.registrySave("g1", "k1", "v1", new Date());
23         }
24
25         List<XxlJobRegistry> list = xxlJobRegistryDao.findAll(1, new Date());
26
27         int ret2 = xxlJobRegistryDao.removeDead(Arrays.asList(1));
28     }
29
30 }