github-code-scanning[bot] commented on code in PR #10184:
URL: https://github.com/apache/dolphinscheduler/pull/10184#discussion_r980724120
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-http/src/test/java/org/apache/dolphinscheduler/plugin/task/http/HttpParametersTest.java:
##########
@@ -75,4 +81,36 @@
Assert.assertEquals(0,httpParameters.getResourceFilesList().size());
}
+ @Test
+ public void testHttpParams() {
+ String paramData =
"{\"localParams\":[],\"httpParams\":[],\"url\":\"https://www.baidu.com/\","
+ +
"\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}";
+ HttpParameters httpParameters = JSONUtils.parseObject(paramData,
HttpParameters.class);
+
+ String body =
"{\"localParams\":[],\"httpParams\":[],\"url\":\"https://www.baidu.com/\","
+ +
"\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}";
+ List<Property> localParams = new ArrayList<>();
+ Property property = new Property();
+ property.setProp("body");
+ property.setDirect(Direct.OUT);
+ property.setType(DataType.VARCHAR);
+ property.setValue("1");
+ localParams.add(property);
+ httpParameters.setLocalParams(localParams);
+ String result = httpParameters.setBodyReturn(body,
httpParameters.getLocalParams());
+ List<Property> varPool = new ArrayList<>();
+ httpParameters.setVarPool(varPool.toString());
+ httpParameters.dealOutParam(result);
+ Map<String, Property> varPoolMap = httpParameters.getVarPoolMap();
Review Comment:
## Unread local variable
Variable 'Map<String,Property> varPoolMap' is never read.
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/1563)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]