保存进度!

This commit is contained in:
2025-03-11 19:31:11 +08:00
parent a3dc3480ba
commit a823e3f963
6 changed files with 126 additions and 24 deletions

View File

@@ -14,6 +14,7 @@ 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.JSONArray;
import com.alibaba.fastjson.JSONObject;
import cn.hsa.zephyr.apisdk.DefaultZephyrClient;
import cn.hsa.zephyr.apisdk.internal.exception.ZephyrApiException;
@@ -48,9 +49,10 @@ public class AppTest
}
}
@Test
public void nhsTest()
{
String url = "";
String url = "172.18.1.150:9040";
String appId = "待定";
String appSecret = "待定";
String funId = "xxx";
@@ -59,7 +61,7 @@ public class AppTest
SignTypeEnum signType = SignTypeEnum.SM3;
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
try
{
DefaultZephyrClient client = new DefaultZephyrClient( url, funId, appId, appSecret,
@@ -73,7 +75,7 @@ public class AppTest
req.setData( jsonObject1 );
resp = client.execute( req );
System.out.println( resp.getData() );
}
catch ( ZephyrApiException e )
@@ -81,4 +83,27 @@ public class AppTest
e.printStackTrace();
}
}
@Test
public void jsonTest()
{
JSONObject requestObject = new JSONObject();
JSONObject item = new JSONObject();
JSONArray hmbList = new JSONArray();
requestObject.put( "topic", "hmbXyxInfo" );
requestObject.put("hmbList", hmbList );
item.put( "psnName", "王炜" );
item.put( "cerno", "350402198106130016" );
item.put( "serviceId", "100007" );
item.put( "status", "1" );
item.put( "xyxNo", "1234567" );
hmbList.add( item );
String json = requestObject.toJSONString();
System.out.println( json );
}
}