From 9c36829278b4e5ff2259bfe0014c19e5345e349d Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 3 Jun 2020 20:05:07 +0800 Subject: [PATCH] ut fix --- .../server/worker/task/datax/DataxTaskTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java index 74da998a03..5a9ff568ae 100644 --- a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java +++ b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTaskTest.java @@ -21,6 +21,7 @@ import java.lang.reflect.Method; import java.util.Arrays; import java.util.Date; import java.util.List; +import java.util.UUID; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -108,7 +109,7 @@ public class DataxTaskTest { taskExecutionContext = Mockito.mock(TaskExecutionContext.class); Mockito.when(taskExecutionContext.getTaskParams()).thenReturn(props.getTaskParams()); Mockito.when(taskExecutionContext.getExecutePath()).thenReturn("/tmp"); - Mockito.when(taskExecutionContext.getTaskAppId()).thenReturn("1"); + Mockito.when(taskExecutionContext.getTaskAppId()).thenReturn(UUID.randomUUID().toString()); Mockito.when(taskExecutionContext.getTenantCode()).thenReturn("root"); Mockito.when(taskExecutionContext.getStartTime()).thenReturn(new Date()); Mockito.when(taskExecutionContext.getTaskTimeout()).thenReturn(10000); @@ -273,6 +274,7 @@ public class DataxTaskTest { @Test public void testBuildDataxJsonFile() throws Exception { + try { setTaskParems(1); Method method = DataxTask.class.getDeclaredMethod("buildDataxJsonFile");