| | |
| | | package com.iailab.sdk; |
| | | |
| | | import com.iailab.framework.test.core.ut.BaseMockitoUnitTest; |
| | | import com.iailab.sdk.auth.client.IailabAuthClient; |
| | | import com.iailab.sdk.auth.client.dto.TokenDTO; |
| | | import com.iailab.sdk.auth.client.vo.AuthLoginReqVO; |
| | | import org.junit.jupiter.api.Test; |
| | | import com.iailab.sdk.auth.client.common.pojo.CommonResult; |
| | | import com.iailab.sdk.auth.client.dto.ApiDataQueryDTO; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author iailab |
| | | */ |
| | | public class IailabClientTest extends BaseMockitoUnitTest { |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest |
| | | public class IailabClientTest { |
| | | |
| | | @Test |
| | | public void testLogin() throws Exception { |
| | | public void testLogin() { |
| | | IailabAuthClient.authenticate(); |
| | | } |
| | | |
| | |
| | | IailabAuthClient.refreshToken(); |
| | | } |
| | | |
| | | @Test |
| | | public void testDoHttp() throws Exception { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | List<String> itemNos = new ArrayList<String>(); |
| | | params.put("start", "2024-06-11 07:24:00"); |
| | | params.put("end", "2024-06-13 00:00:00"); |
| | | itemNos.add("P0000100010"); |
| | | params.put("itemNos", itemNos); |
| | | // 准备参数 |
| | | String s = IailabAuthClient.doHttp("POST", "http://172.16.8.100/admin-api/data/api/query-plans/chart", params); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | @Test |
| | | public void testQueryPointsRealValue() { |
| | | List<String> pointNos = new ArrayList<>(); |
| | | pointNos.add("111"); |
| | | CommonResult<Map<String, Object>> stringObjectMap = IailabAuthClient.getInstance().queryPointsRealValue(pointNos); |
| | | System.out.println(stringObjectMap); |
| | | } |
| | | |
| | | } |