### Question:
DependentParam implements ProcessAddTaskParam, InitializingBean { @Override public JsonNode addImportSpecialParam(JsonNode taskNode) { ObjectNode dependentParameters = JSONUtils.parseObject(taskNode.path(DEPENDENCE).asText()); if(dependentParameters != null){ ArrayNode dependTaskList = (ArrayNode) dependentParameters.path("dependTaskList"); for (int h = 0; h < dependTaskList.size(); h++) { ObjectNode dependentTaskModel = (ObjectNode) dependTaskList.path(h); ArrayNode dependItemList = (ArrayNode) dependentTaskModel.get("dependItemList"); for (int k = 0; k < dependItemList.size(); k++) { ObjectNode dependentItem = (ObjectNode) dependItemList.path(k); Project dependentItemProject = projectMapper.queryByName(dependentItem.path("projectName").asText()); if(dependentItemProject != null){ ProcessDefinition definition = processDefineMapper.queryByDefineName(dependentItemProject.getId(),dependentItem.path("definitionName").asText()); if(definition != null){ dependentItem.put("projectId",dependentItemProject.getId()); dependentItem.put("definitionId",definition.getId()); } } } } ((ObjectNode)taskNode).set(DEPENDENCE, dependentParameters); } return taskNode; }  @Override JsonNode addExportSpecialParam(JsonNode taskNode); @Override JsonNode addImportSpecialParam(JsonNode taskNode); @Override void afterPropertiesSet();  }### Answer:
@Test public void testAddImportDependentSpecialParam() throws JSONException { String dependentJson = "{\"workerGroupId\":-1,\"description\":\"\",\"runFlag\":\"NORMAL\"" + ",\"type\":\"DEPENDENT\",\"params\":{},\"timeout\":{\"enable\":false," + "\"strategy\":\"\"},\"maxRetryTimes\":\"0\",\"taskInstancePriority\":\"MEDIUM\"" + ",\"name\":\"dependent\"," + "\"dependence\":{\"dependTaskList\":[{\"dependItemList\":[{\"dateValue\":\"today\"," + "\"definitionName\":\"shell-1\",\"depTasks\":\"shell-1\",\"projectName\":\"test\"," + "\"projectId\":1,\"cycle\":\"day\",\"definitionId\":7}],\"relation\":\"AND\"}]," + "\"relation\":\"AND\"},\"retryInterval\":\"1\",\"preTasks\":[],\"id\":\"tasks-55485\"}"; ObjectNode taskNode = JSONUtils.parseObject(dependentJson); if (StringUtils.isNotEmpty(taskNode.path("type").asText())) { String taskType = taskNode.path("type").asText(); ProcessAddTaskParam addTaskParam = TaskNodeParamFactory.getByTaskType(taskType); JsonNode dependent = addTaskParam.addImportSpecialParam(taskNode); JSONAssert.assertEquals(taskNode.toString(), dependent.toString(), false); } String dependentEmpty = "{\"workerGroupId\":-1,\"description\":\"\",\"runFlag\":\"NORMAL\"" + ",\"type\":\"DEPENDENT\",\"params\":{},\"timeout\":{\"enable\":false," + "\"strategy\":\"\"},\"maxRetryTimes\":\"0\",\"taskInstancePriority\":\"MEDIUM\"" + ",\"name\":\"dependent\",\"retryInterval\":\"1\",\"preTasks\":[],\"id\":\"tasks-55485\"}"; JsonNode taskNodeEmpty = JSONUtils.parseObject(dependentEmpty); if (StringUtils.isNotEmpty(taskNodeEmpty.path("type").asText())) { String taskType = taskNodeEmpty.path("type").asText(); ProcessAddTaskParam addTaskParam = TaskNodeParamFactory.getByTaskType(taskType); JsonNode dependent = addTaskParam.addImportSpecialParam(taskNode); JSONAssert.assertEquals(taskNodeEmpty.toString(), dependent.toString(), false); } }