保存进度!
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2025-03-11 09:27:40
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /cpicxim-XMNHSA-repeater/src/test/java/com/cpic/xim/huixiabao/AppTest.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2023} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.huixiabao;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import cn.hsa.zephyr.apisdk.DefaultZephyrClient;
|
||||
import cn.hsa.zephyr.apisdk.internal.exception.ZephyrApiException;
|
||||
import cn.hsa.zephyr.apisdk.internal.util.encrypt.EncryptionModeEnum;
|
||||
import cn.hsa.zephyr.apisdk.internal.util.encrypt.SignTypeEnum;
|
||||
import cn.hsa.zephyr.apisdk.request.DefaultZephyrRequest;
|
||||
import cn.hsa.zephyr.apisdk.response.DefaultZephyrResponse;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
{
|
||||
private Logger logger = LoggerFactory.getLogger( AppTest.class );
|
||||
|
||||
/**
|
||||
* Rigorous Test :-)
|
||||
*/
|
||||
@Test
|
||||
public void shouldAnswerWithTrue()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLog()
|
||||
{
|
||||
for ( int i = 0; i < 10000; i++ )
|
||||
{
|
||||
// System.out.print("test!");
|
||||
logger.error( "test!!!!" );
|
||||
}
|
||||
}
|
||||
|
||||
public void nhsTest()
|
||||
{
|
||||
String url = "";
|
||||
String appId = "待定";
|
||||
String appSecret = "待定";
|
||||
String funId = "xxx";
|
||||
String encKey = "A5B6E00DA599G56C41ABFE23A74E6E60";
|
||||
String signKey = "待定";
|
||||
|
||||
SignTypeEnum signType = SignTypeEnum.SM3;
|
||||
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
|
||||
|
||||
try
|
||||
{
|
||||
DefaultZephyrClient client = new DefaultZephyrClient( url, funId, appId, appSecret,
|
||||
signType, signKey, encType, encKey );
|
||||
DefaultZephyrRequest req = new DefaultZephyrRequest();
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
DefaultZephyrResponse resp = null;
|
||||
|
||||
jsonObject1.put( "code", "XXXXXXXXXXXXXXXXXX" );
|
||||
jsonObject1.put( "scene_code", "XXX" );
|
||||
|
||||
req.setData( jsonObject1 );
|
||||
resp = client.execute( req );
|
||||
|
||||
System.out.println( resp.getData() );
|
||||
}
|
||||
catch ( ZephyrApiException e )
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user