This commit is contained in:
tanghc
2021-04-08 17:17:44 +08:00
parent 31202908a4
commit 3804bf33a7
49 changed files with 481 additions and 101 deletions

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId>
<version>4.3.4-SNAPSHOT</version>
<version>4.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent>

View File

@@ -422,6 +422,25 @@ public class AllInOneTest extends TestBase {
client.execute(requestBuilder);
}
/**
* 未知异常
*/
public void testException() {
Client.RequestBuilder requestBuilder = new Client.RequestBuilder()
.method("goods.update2")
.version("1.0")
.bizContent(new BizContent().add("goods_name", "Apple"))
.httpMethod(HttpTool.HTTPMethod.POST)
.callback((requestInfo, responseData) -> {
System.out.println(responseData);
String node = requestInfo.getDataNode();
JSONObject jsonObject = JSON.parseObject(responseData).getJSONObject(node);
Assert.assertEquals("isp.service-unknown-error", jsonObject.getString("sub_code"));
});
client.execute(requestBuilder);
}
static class BizContent extends HashMap<String, Object> {
public BizContent add(String key, Object value) {
this.put(key, value);