ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package com.vci.server.framework.appConfig;
import static org.junit.Assert.*;
import java.util.Date;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
 
import com.vci.common.objects.UserEntity;
    /**
    * AppConfigDetail DAO Service Test
    *
    */
    public class AppConfigDetailServiceTest {
        private UserEntity userEntity = new UserEntity();
        
        @BeforeClass
        public static void setUpBeforeClass() throws Exception {
        }
    
        @AfterClass
        public static void tearDownAfterClass() throws Exception {
        }
    
        @Before
        public void setUp() throws Exception {
            userEntity.setUserName("xc");
            userEntity.setModule(this.getClass().getName());
            userEntity.setIp("192.168.0.26");
        }
    
        @After
        public void tearDown() throws Exception {
        }
    
        @Test
        public void testSaveAppConfigDetail() {
            AppConfigDetail object = new AppConfigDetail();
            AppConfigDetailService service = new AppConfigDetailService(userEntity);
            object.setId("");
            object.setName("");
            object.setDesc("");
            object.setKey("");
            object.setValue("");
            object.setCategoryId("");
            boolean res = service.saveAppConfigDetail(object);
            assertEquals(true, res);
        }
    
        @Test
        public void testUpdateAppConfigDetail() {
            AppConfigDetail object = new AppConfigDetail();
            AppConfigDetailService service = new AppConfigDetailService(userEntity);
            object.setId("");
            object.setName("");
            object.setDesc("");
            object.setKey("");
            object.setValue("");
            object.setCategoryId("");
            boolean res = service.updateAppConfigDetail(object);
            assertEquals(true, res);
        }
        
        @Test
        public void testDeleteAppConfigDetailStringArray() {
            AppConfigDetailService service = new AppConfigDetailService(userEntity);
            boolean res = service.deleteAppConfigDetail(new String[]{"123", "456"});
            assertEquals(true, res);
        }
    
        @Test
        public void testGetAppConfigDetails() {
//            AppConfigDetailService service = new AppConfigDetailService(userEntity);
//            List<AppConfigDetail> objects = service.getAppConfigDetails();
//            int size = objects.size();
//            for(AppConfigDetail object : objects){
//                System.out.println(object);
//            }
//            assertEquals(2, size);
        }
        
        @Test
        public void testGetAppConfigDetailById() {
//            AppConfigDetailService service = new AppConfigDetailService(userEntity);
//            AppConfigDetail object = service.getAppConfigDetailById("123");
//            assertEquals("123", object.getId());
        }
    }