CaptionTest.java
1.46 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
50
51
52
53
54
55
package com.viontech.storage.mapper;
import cn.hutool.json.JSONConfig;
import cn.hutool.json.JSONUtil;
import com.viontech.storage.model.Caption;
import com.viontech.storage.model.CaptionSet;
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 CaptionTest {
@Resource
private CaptionMapper captionMapper;
@Test
public void insetCaptionSet() {
Caption caption = new Caption()
.setCaptionSetId(1L)
.setEnabled(true)
.setBgColor(1)
.setBgTransparency(1)
.setDateFormat("yyyy-MM-dd HH:mm:ss:xxx")
.setFont(1)
.setFontSize(10)
.setPicType(1)
.setFgColor(1)
.setContext("testContext");
int insert = captionMapper.insert(caption);
System.out.println(insert);
}
@Test
public void captionTest() {
List<Caption> captions = captionMapper.selectList(null);
captions.forEach(x -> System.out.println(JSONUtil.toJsonStr(x, JSONConfig.create().setDateFormat("yyyy-MM-dd HH:mm:ss"))));
}
}