admin
2022-04-16 04f09e52ffd4681bdfd85e51acd3da0d1280c3d3
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
package com.hxh.spring.test.video;
 
import com.yeshi.buwan.dao.VideoResourceMapExtraInfoDao;
import com.yeshi.buwan.domain.VideoResource;
import com.yeshi.buwan.domain.video.VideoResourceInfoMap;
import com.yeshi.buwan.service.imp.VideoResourceService;
import com.yeshi.buwan.service.inter.video.VideoResourceInfoMapService;
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 javax.annotation.Resource;
import java.util.List;
 
/**
 * @author hxh
 * @title: VideoInfoMapTest
 * @description: TODO
 * @date 2022/3/22 14:00
 */
 
 
@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试
@ContextConfiguration(locations = {"classpath:spring.xml"})
@WebAppConfiguration
public class VideoInfoMapTest {
 
    @Resource
    private VideoResourceInfoMapService videoResourceInfoMapService;
 
    @Resource
    private VideoResourceService videoResourceService;
 
    @Test
    public void add() throws Exception {
        VideoResourceInfoMap map = new VideoResourceInfoMap();
        map.setDetailSystemId("51");
        map.setName("爱奇艺");
        map.setResourceId(22L);
        map.setIcon("https://www.baidu.com");
        videoResourceInfoMapService.add(map);
    }
 
    @Test
    public void filter() throws Exception {
        List<VideoResource> resourceList = videoResourceService.getResourceList();
        resourceList = videoResourceInfoMapService.filter("51", resourceList);
        System.out.println(resourceList);
    }
 
}