RedisServiceTest.java
1.3 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
56
57
58
59
60
61
package com.sy.service;
import com.alibaba.fastjson.JSON;
import com.sy.model.LandBusinessTypeList;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.jupiter.api.Assertions.*;
@RunWith(SpringRunner.class)
@SpringBootTest
class RedisServiceTest {
@Autowired
RedisService redisService;
@Test
void expire() {
}
@Test
void hasKey() {
}
@Test
void del() {
}
@Test
void deleteBatchByKeys() {
}
@Test
void get() {
}
@Test
void set() {
LandBusinessTypeList list = new LandBusinessTypeList();
list.setTrailerFrameNo("豫A61CR7");
list.setBarcode("123-3132");
list.setAislewt(2022.22);
list.setId("020201");
list.setStartsatation("西货站");
list.setEndstation("北货站");
redisService.set(list.getTrailerFrameNo(), JSON.toJSONString(list),60*30);
String userJson = redisService.get(list.getTrailerFrameNo());
System.out.println("userJson = " + userJson);
LandBusinessTypeList u = JSON.parseObject(userJson,LandBusinessTypeList.class);
}
@Test
void testSet() {
}
}