CaptionSetTest.java
1.28 KB
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
package com.viontech.storage.mapper;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.viontech.storage.mapper.CaptionSetMapper;
import com.viontech.storage.model.CaptionSet;
import com.viontech.storage.service.CaptionService;
import com.viontech.storage.service.CaptionSetService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.List;
/**
* .
*
* @author 谢明辉
* @date 2021/11/8
*/
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("test")
public class CaptionSetTest {
@Resource
private CaptionSetService captionSetService;
@Test
public void insetCaptionSet() {
CaptionSet captionSet = new CaptionSet();
captionSet.setName("name");
captionSet.setIntro("intro");
boolean save = captionSetService.save(captionSet);
System.out.println(JSONUtil.toJsonStr(captionSet));
}
@Test
public void selectCaptionSet() {
List<CaptionSet> captionSets = captionSetService.list();
captionSets.forEach(x -> System.out.println(JSONUtil.toJsonStr(x)));
}
}