MainTest.java
1.52 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.fanxing.task;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.viontech.fanxing.commons.model.Channel;
import com.viontech.fanxing.commons.model.DictCode;
import com.viontech.fanxing.commons.model.Task;
import com.viontech.fanxing.task.service.OpsClientService;
import com.viontech.fanxing.task.service.impl.TaskServiceImpl;
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;
/**
* .
*
* @author 谢明辉
* @date 2021/7/21
*/
@SpringBootTest
@RunWith(SpringRunner.class)
@ActiveProfiles("test")
public class MainTest {
@Resource
private OpsClientService opsClientService;
@Resource
private TaskServiceImpl taskService;
@Test
public void opsClientTest() {
DictCode nvs3000 = opsClientService.getDictCodeByUnid("460b359f-0bc6-11ec-a74d-0242ac11001d");
Channel channel = opsClientService.getChannelByChannelUnid("2200001201000D01");
String defaultConfig = opsClientService.getContentByName("defaultConfig");
System.out.println(JSON.toJSONString(nvs3000));
System.out.println(JSON.toJSONString(channel));
System.out.println(JSON.toJSONString(defaultConfig));
}
}