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);
|
}
|
|
}
|