### Question:
UpgradeDao extends AbstractBaseDao { protected void updateProcessDefinitionJsonWorkerGroup(){ WorkerGroupDao workerGroupDao = new WorkerGroupDao(); ProcessDefinitionDao processDefinitionDao = new ProcessDefinitionDao(); Map<Integer,String> replaceProcessDefinitionMap = new HashMap<>(); try { Map<Integer, String> oldWorkerGroupMap = workerGroupDao.queryAllOldWorkerGroup(dataSource.getConnection()); Map<Integer,String> processDefinitionJsonMap = processDefinitionDao.queryAllProcessDefinition(dataSource.getConnection()); for (Map.Entry<Integer,String> entry : processDefinitionJsonMap.entrySet()){ ObjectNode jsonObject = JSONUtils.parseObject(entry.getValue()); ArrayNode tasks = JSONUtils.parseArray(jsonObject.get("tasks").toString()); for (int i = 0 ;i < tasks.size() ; i++){ ObjectNode task = (ObjectNode) tasks.path(i); ObjectNode workerGroupNode = (ObjectNode) task.path("workerGroupId"); Integer workerGroupId = -1; if(workerGroupNode != null && workerGroupNode.canConvertToInt()){ workerGroupId = workerGroupNode.asInt(-1); } if (workerGroupId == -1) { task.put("workerGroup", "default"); }else { task.put("workerGroup", oldWorkerGroupMap.get(workerGroupId)); } } jsonObject.remove("task"); jsonObject.put("tasks",tasks); replaceProcessDefinitionMap.put(entry.getKey(),jsonObject.toString()); } if (replaceProcessDefinitionMap.size() > 0){ processDefinitionDao.updateProcessDefinitionJson(dataSource.getConnection(),replaceProcessDefinitionMap); } }catch (Exception e){ logger.error("update process definition json workergroup error",e); } }  static DataSource getDataSource(); static DbType getDbType(); void initSchema(); void initSchema(String initSqlPath); abstract boolean isExistsTable(String tableName); abstract boolean isExistsColumn(String tableName,String columnName); String getCurrentVersion(String versionName); void upgradeDolphinScheduler(String schemaDir); void upgradeDolphinSchedulerWorkerGroup(); void updateVersion(String version); static final Logger logger; }### Answer:
@Test public void testQueryQueryAllOldWorkerGroup() throws Exception{ postgresqlUpgradeDao.updateProcessDefinitionJsonWorkerGroup(); }