dongyukun
2024-12-31 0a2b23ad3f30dfb01c5d590fb98f39e93bfe1932
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
package com.xxl.job.admin.dao;
 
import com.xxl.job.admin.core.model.XxlJobGroup;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
 
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
 
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class XxlJobGroupDaoTest {
 
    @Resource
    private XxlJobGroupDao xxlJobGroupDao;
 
    @Test
    public void test(){
        List<XxlJobGroup> list = xxlJobGroupDao.findAll();
 
        List<XxlJobGroup> list2 = xxlJobGroupDao.findByAddressType(0);
 
        XxlJobGroup group = new XxlJobGroup();
        group.setAppname("setAppName");
        group.setTitle("setTitle");
        group.setAddressType(0);
        group.setAddressList("setAddressList");
        group.setUpdateTime(new Date());
 
        int ret = xxlJobGroupDao.save(group);
 
        XxlJobGroup group2 = xxlJobGroupDao.load(group.getId());
        group2.setAppname("setAppName2");
        group2.setTitle("setTitle2");
        group2.setAddressType(2);
        group2.setAddressList("setAddressList2");
        group2.setUpdateTime(new Date());
 
        int ret2 = xxlJobGroupDao.update(group2);
 
        int ret3 = xxlJobGroupDao.remove(group.getId());
    }
 
}