MainTest.java 1.52 KB
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));

    }
}