src/test/java/com/hxh/spring/test/ConfigTest.java
@@ -1,18 +1,42 @@
package com.hxh.spring.test;
import com.yeshi.buwan.domain.Config;
import com.yeshi.buwan.service.imp.ConfigService;
import com.yeshi.buwan.util.BeanUtil;
import com.yeshi.buwan.dao.system.SystemConfigDao;
import com.yeshi.buwan.domain.system.SystemConfig;
import com.yeshi.buwan.job.AdJob;
import com.yeshi.buwan.service.inter.system.SystemConfigService;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import java.util.List;
import javax.annotation.Resource;
import java.util.Date;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring.xml"})
@WebAppConfiguration
public class ConfigTest {
    @Resource
    private SystemConfigService systemConfigService;
    @Resource
    private SystemConfigDao systemConfigDao;
    @Test
    public void test1() {
        ConfigService configService = BeanUtil.getBean(ConfigService.class);
        List<Config> configList = configService.getConfig(44L, 1);
    public void addSystemConfig() {
        SystemConfig systemConfig = new SystemConfig();
        systemConfig.setBeizhu("");
        systemConfig.setKey("iqiyi_update_video_name");
        systemConfig.setName("爱奇艺特殊更新的视频名称");
        systemConfig.setValue("《卧底》,没关系,是青春啊!,山海情(原声版),我的时代,你的时代,你好,安怡");
        systemConfig.setCreateTime(new Date());
        systemConfig.setId(SystemConfig.createId(systemConfig.getKey()));
        systemConfigDao.save(systemConfig);
    }
}