From 3fa4dd702b6601f6d829b2579177dae229d1ad0f Mon Sep 17 00:00:00 2001 From: simon824 Date: Sat, 13 Jun 2020 09:47:18 +0800 Subject: [PATCH] Resolved the conflict --- .../common/task/HttpParametersTest.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/task/HttpParametersTest.java b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/task/HttpParametersTest.java index abcfca83dd..6bd3bc76b5 100644 --- a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/task/HttpParametersTest.java +++ b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/task/HttpParametersTest.java @@ -16,20 +16,13 @@ */ package org.apache.dolphinscheduler.common.task; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang.StringUtils; import org.apache.dolphinscheduler.common.enums.HttpCheckCondition; import org.apache.dolphinscheduler.common.enums.HttpMethod; -import org.apache.dolphinscheduler.common.process.HttpProperty; -import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.http.HttpParameters; +import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.junit.Assert; import org.junit.Test; -import com.alibaba.fastjson.JSON; - /** * http parameter */ @@ -40,7 +33,7 @@ public class HttpParametersTest { public void testGenerator(){ String paramData = "{\"localParams\":[],\"httpParams\":[],\"url\":\"https://www.baidu.com/\"," + "\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}"; - HttpParameters httpParameters = JSON.parseObject(paramData, HttpParameters.class); + HttpParameters httpParameters = JSONUtils.parseObject(paramData, HttpParameters.class); Assert.assertEquals(10000,httpParameters.getConnectTimeout() ); @@ -57,7 +50,7 @@ public class HttpParametersTest { public void testCheckParameters(){ String paramData = "{\"localParams\":[],\"httpParams\":[],\"url\":\"https://www.baidu.com/\"," + "\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}"; - HttpParameters httpParameters = JSON.parseObject(paramData, HttpParameters.class); + HttpParameters httpParameters = JSONUtils.parseObject(paramData, HttpParameters.class); Assert.assertTrue( httpParameters.checkParameters()); Assert.assertEquals(10000,httpParameters.getConnectTimeout() ); @@ -74,7 +67,7 @@ public class HttpParametersTest { public void testCheckValues() { String paramData = "{\"localParams\":[],\"httpParams\":[],\"url\":\"https://www.baidu.com/\"," + "\"httpMethod\":\"GET\",\"httpCheckCondition\":\"STATUS_CODE_DEFAULT\",\"condition\":\"\",\"connectTimeout\":\"10000\",\"socketTimeout\":\"10000\"}"; - HttpParameters httpParameters = JSON.parseObject(paramData, HttpParameters.class); + HttpParameters httpParameters = JSONUtils.parseObject(paramData, HttpParameters.class); Assert.assertTrue( httpParameters.checkParameters()); Assert.assertEquals(10000,httpParameters.getConnectTimeout() );